You are deploying a web application to Azure App Service. The application must retrieve a database connection string stored in Azure Key Vault named keyvault1. You need to configure an application setting named ConnectionString using a Key Vault reference that points to a secret named dbsecret. Which of the following represents the correct format to use as the value of the application setting?
- @Microsoft.KeyVault(SecretUri=https://keyvault1.vault.azure.net/secrets/dbsecret/)Answer
- B@Azure.KeyVault(SecretUri=https://keyvault1.vault.azure.net/secrets/dbsecret/)
- C@Microsoft.KeyVault(Uri=https://keyvault1.vault.azure.net/secrets/dbsecret/)
- D@Microsoft.KeyVault(Vault=keyvault1;Secret=dbsecret)
Answer
The correct format is '@Microsoft.KeyVault(SecretUri=https://keyvault1.vault.azure.net/secrets/dbsecret/)'
The correct syntax uses the prefix '@Microsoft.KeyVault' and the parameter 'SecretUri' to specify the full URI of the secret in Azure Key Vault.
Step-by-Step Solution
Key Concept
Key Vault Reference Syntax in Azure App Service
Estimated Time:45s