简体   繁体   English

DataProtectionConfigurationProvider 在我的 Azure 应用服务上不起作用

[英]DataProtectionConfigurationProvider not working on my Azure app service

I am trying to encrypt my connection string data in my App.config files of my project.我正在尝试在我的项目的 App.config 文件中加密我的连接字符串数据。 I found this topic , the solution is basically, I give my connection string -> it encrypts it -> I put the given encrypted string into my App.config and bam.我找到了这个主题,解决方案基本上是,我给出我的连接字符串->它加密它->我将给定的加密字符串放入我的 App.config 和 bam 中。 It works (normally).它工作(通常)。

This is what the encrypted string looks like:这是加密字符串的样子:

<connectionStrings configProtectionProvider="DataProtectionConfigurationProvider">
    <EncryptedData> 
        <CipherData> 
            <CipherValue>AQAAANCMnd...</CipherValue> 
        </CipherData> 
    </EncryptedData> 
</connectionStrings>

The solution works on my local solution, I have access to my DB without any problem.该解决方案适用于我的本地解决方案,我可以毫无问题地访问我的数据库。 However, when I upload the project to my Azure app service, the database isn't reached.但是,当我将项目上传到我的 Azure 应用服务时,无法访问数据库。 I'm sure it's because of the encrypted data but I don't know why (the db connection works without the encryption).我确定这是因为加密的数据,但我不知道为什么(数据库连接在没有加密的情况下工作)。

So if you have an idea, you are my only hope.所以如果你有想法,你就是我唯一的希望。 I would like to keep the encryption simple, I found a lot of other solutions but I find them pretty complicated to make it work.我想保持加密简单,我发现了很多其他解决方案,但我发现它们非常复杂,无法使其工作。

Thanks by advance!提前感谢!

config file encryption method for Azure web site and web job Azure web 站点和 web 作业的配置文件加密方法

Because of the particularity of the Azure Web AppService platform, so the C# config original encryption method of DataProtectionConfigurationProvider and RSAProtectedConfigurationProvider in the Azure platform is not available. Because of the particularity of the Azure Web AppService platform, so the C# config original encryption method of DataProtectionConfigurationProvider and RSAProtectedConfigurationProvider in the Azure platform is not available.

After reading the article carefully, you can know that DataProtectionConfigurationProvider cannot take effect in the traditional way of Azure web app.仔细阅读文章可以知道,DataProtectionConfigurationProvider不能以Azure web app的传统方式生效。 You can refer to the solution in the article for processing.可以参考文章中的解决方案进行处理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Datetimeoffset 不适用于 azure 应用服务 - Datetimeoffset not working on azure app service COMPLUS_LoaderOptimization 在 Azure 应用服务中不起作用 - COMPLUS_LoaderOptimization not working in Azure app service JsonProperty似乎无法在Windows Azure应用程序服务上运行 - JsonProperty seems to not working on a windows azure app service SendGrid无法在Azure App Service中运行 - SendGrid not working from Azure App Service 无法使用app.config中的提供程序“DataProtectionConfigurationProvider”进行解密 - Failed to decrypt using provider 'DataProtectionConfigurationProvider' in app.config 编辑应用服务编辑器以调整我的 Azure 服务机器人的阈值 - Editing the App Service Editor to adjust the Threshold of my Azure Service Bot Azure应用程序日志记录不适用于我的Web App - Azure Application Logging not working for my Web App DataProtectionConfigurationProvider解密 - DataProtectionConfigurationProvider decryption Azure应用服务跟踪 - Azure App Service Tracing Azure 应用服务限制 - 允许应用服务 A 用于应用服务 B - Azure App Service Restrictions - allow app service A for app service B
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM