拥有一个托管在 Azure 中的 Asp.NET 表单 Web 应用程序,其中包含一个需要引用 Azure Key Vault 中的值的 connectionstrings.config 文件。
此条目由另一个集成系统 Sitecore 使用,该系统使用 Azure 认知搜索进行内部搜索。因此,需要在配置文件中更改该值。
例如,这是配置中的一个条目,需要来自 Key Vault 的值。
<add name="cloud.search" connectionString="serviceUrl=https://someurl.com;apiVersion=2017-11-11;apiKey=**key vault value**"/>
这里有没有办法从密钥库中引用值?如有必要,我可以从 Azure 上的 Web 应用程序配置设置中引用一个值——这反过来又可以从密钥库中提取值。
我们可以在我们的配置文件中引用
Environment Variable
以及Key Vault
。
中所述这里有没有办法从 keyvault 引用值?
参考
Key Vault
,使用keyVault
从我们的WebApp
访问ManagedIdentity
秘密的语法必须是,
[email protected](SecretUri=value from KeyVault Secret)
例子:
<connectionStrings>
<add name="MyConn" connectionString="@Microsoft.KeyVault(SecretUri=https://harshukv5apr.vault.azure.net/secrets/MyDBContext/**********)" providerName="****" />
</connectionStrings>
Azure 应用程序连接字符串
System asigned Identity
.