在 .net 应用程序中屏蔽客户端机密

Masking client secrets in .net application

对于我的 .net 应用程序。有一些 powerbi 值,例如应用程序 ID 和客户端密码。但为了安全起见,他们应该在 azure key vault 中。这个问题的解决方法是什么?

  • 通过使用 Key Vault,ASP.NET 中的配置生成器提供了一种方法来编辑和覆盖 web.config 文件中的设置。
  • 向 Key Vault 添加机密 - Steps to create Key Vault
  • 机密的名称必须与您要替换它们的应用设置同名,这一点很重要。例如,如果您的 Web.config 文件包含一个名为 MyConnStr 的应用程序选项,则您必须在 Key Vault 中创建一个具有相同名称和值的机密。
  • 让您的 Web 应用程序访问保存在 Key Vault 中的秘密。使用 Web 应用程序的托管身份功能。

Steps to read a secret stored in an Azure Key Vault instance and Use a managed identity to connect Key Vault to an Azure web app in .NET

更多信息请参考Key Vault support to your ASP.NET - Azure Key Vault and