最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

azure - Using Key Vault in App Service Deployment Slot Service Connector - Stack Overflow

programmeradmin4浏览0评论

I have spent the past few hours trying to work this out. Please help me understand what I'm doing wrong.

I have setup a new app with deployment slots. In the production/main deployment slot, I am able to create a service connector to my SQL Database using a connection string, and able to store the connection string in the key vault; like in the following pic.

However, when I try to do the same for a slot I created, the option to store the value in the key vault doesn't appear; like in the pic below.

As far as I can tell, everything is correctly configured, i.e., subnet, managed service identities, etc. What could I possibly doing wrong?

I have spent the past few hours trying to work this out. Please help me understand what I'm doing wrong.

I have setup a new app with deployment slots. In the production/main deployment slot, I am able to create a service connector to my SQL Database using a connection string, and able to store the connection string in the key vault; like in the following pic.

However, when I try to do the same for a slot I created, the option to store the value in the key vault doesn't appear; like in the pic below.

As far as I can tell, everything is correctly configured, i.e., subnet, managed service identities, etc. What could I possibly doing wrong?

Share Improve this question asked Mar 10 at 12:00 David PoxonDavid Poxon 2,5035 gold badges25 silver badges45 bronze badges 1
  • Which plan are you using @DavidPoxon? – Pravallika KV Commented Mar 14 at 11:17
Add a comment  | 

1 Answer 1

Reset to default 0

You can store the connection string in Key vault only in the Production slot.

These options are not available in deployment slots.

I have tested the same and noticed the connection string can only be stored in App Configuration.

As an alternative, try below:

Create a service connector to SQL Database using a connection string in Production slot and store it in Azure key vault.

Clone the settings from main web app while adding a new slot.

You can follow below steps to store SQL connection string in Key Vault and use it in web app:

  • Add the SQL connection string as secret in Key Vault
  • Enable managed identity in Web App slot.
  • Navigate to Keyvault=>Access Role(IAM) and assign Key Vault Administrator role to Web app slot's managed identity.
  • Add the key vault reference as App Setting in Azure Web app slot.
@Microsoft.KeyVault(SecretUri=https://<KeyvaultName>.vault.azure/secrets/<secretName>/Secret_Version)
发布评论

评论列表(0)

  1. 暂无评论