You are deploying a web application to an Azure App Service web app. The application must retrieve a database connection string stored as a secret named `DbPassword` in an Azure Key Vault named `vault-prod`. You configure a system-assigned managed identity for the web app and grant it the necessary Key Vault access. You need to configure a new application setting in the web app that references this secret. Which of the following application setting values uses the correct syntax to reference the Key Vault secret by vault and secret name?
- A@Azure.KeyVault(VaultName=vault-prod;SecretName=DbPassword)
- @Microsoft.KeyVault(VaultName=vault-prod;SecretName=DbPassword)Answer
- C@Microsoft.KeyVault(SecretName=DbPassword)
- D@Microsoft.KeyVault(vault-prod/DbPassword)
Answer
The application setting value must be set to `@Microsoft.KeyVault(VaultName=vault-prod;SecretName=DbPassword)`.
The syntax `@Microsoft.KeyVault(VaultName=vault-prod;SecretName=DbPassword)` is correct because it uses the standard `@Microsoft.KeyVault` prefix and specifies both required parameters: `VaultName` and `SecretName` separated by a semicolon.
Step-by-Step Solution
Key Concept
Configuring Key Vault references in Azure App Service application settings.