c# - Azure 诊断 - 加密 cscfg 中的连接字符串

标签 c# azure encryption diagnostics

在我们的项目中,我们想要使用 Azure 诊断。一切都很好,除了一件事之外,似乎无法加密 cscfg 文件中的 Azure 诊断连接字符串。以 cscfg 中的此配置部分为例(实际值被隐藏):

在上面,整个 conn 字符串(也称为 AccountKey)在 Azure 门户中可见。这是我们的问题。

验证链接: https://manage.windowsazure.com/microsoft.onmicrosoft.com#Workspaces/CloudServicesExtension/CloudService/your-cloud-srv/configure

此外,还可以在这个 cscfg 文件中看到它。在推出期间,我们不想公开 AccountKey 除门户管理员之外的任何其他方。 现在,我的问题是:是否可以在 cscfg 文件中使用加密的 AccountKey,或者,建议的方式是什么来激活 Azure 诊断,以便在 Azure Diag 激活之前可以解密 conn 字符串?

这一切都必须与最新的 Azure SDK 2.71 或 2.8.1 配合使用。

更新:如果我添加加密的 conn 字符串来表示 cscfg,例如 EncDiagConnString,如果我在 Azure 角色中提供解密的 conn 字符串,是否仍然可以使用 Azure SDK 2.7.1 或 Azure SDK 2.8.1 以编程方式启动诊断OnStart() 方法?

更新2:似乎可以通过Azure管理API(REST API)在云服务之外激活Azure诊断,最好的选择似乎是使用Azure PowerShell cmdlet:https://azure.microsoft.com/en-us/documentation/articles/cloud-services-dotnet-diagnostics/

最佳答案

为此,您有两个选项是将连接字符串存储在 App Settings / Connections strings! 中。对于该应用程序。或者使用 Azure Key Vault存储应用程序 secret 并以编程方式访问它们。

关于c# - Azure 诊断 - 加密 cscfg 中的连接字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35032765/

相关文章:

java - 在 Java 中加密 Zip 条目而不是整个 Zip 文件

c# - 从html获取特定数据

java - Spring Boot 应用程序的 Azure 应用服务部署无法从 Jenkins 运行

objective-c - 将 NSData 字节转换为 NSString

azure - 选项或在 Azure 中设置测试环境

azure - Azure 上 "Plan Service"级别上的 SocketException

c# - Rijndael 加密在 Windows Server 2012 上不起作用

c# - ASP.NET MVC3 : Validation Summary for Create Action (Server Side Validation)

c# - 在 ASP.NET MVC 中填充下拉列表

c# - 使用 MailKit 将消息写入磁盘上的文件夹