本文介绍了来自Key Vault Secret的应用服务连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好, 

我创建了包含我的连接字符串的密钥保管库密码。 

I created the key vault secret containing my connection string. 

添加了对我的appsettings.json 

Added a reference to my appsettings.json 

" CafcassECMSTitleContext":" Configuration",@ Microsoft.KeyVault(https://mykevaulr-0-kv.vault.azure.net/secrets/mysecret )

"CafcassECMSTitleContext": "Configuration", @Microsoft.KeyVault(https://mykevaulr-0-kv.vault.azure.net/secrets/mysecret)

尝试访问我的API时获取502. 

Getting 502 when trying to access my API. 

应用程序已连接到keyvault(我可以在launchSettings中看到相关条目。连接服务下的json和绿色标记)

The application is connected to the keyvault (I can see relevant entries in launchSettings.json and a green mark under ConnectedServices)

创建的访问策略。确保我的AppService是KeyVault的所有者和贡献者。 

Created access policy. made sure my AppService is the owner as well as contributor of the KeyVault. 

仍然没有运气。

是参考字符串(上图)正确?如何在我的配置中引用存储在密钥保管库中的密钥下的连接字符串。 

Is the reference string (above) correct? How do I reference the connection string stored under a secret in the Key Vault - in my configuration. 

???

推荐答案

您可以尝试下面提到的参考语法,让我们知道结果。


这篇关于来自Key Vault Secret的应用服务连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 18:44