Question

Difficulty: EasyConfigure Azure App Service Web Apps

Your company is deploying a web application to Azure App Service. The application requires a database connection string that is stored securely as a secret named 'db-conn' in an Azure Key Vault named 'kv-prod'. You need to configure the web app's application settings to reference this Key Vault secret using its name. Which value should you use for the application setting?

  1. @Microsoft.KeyVault(VaultName=kv-prod;SecretName=db-conn)Answer
  2. B
    @Microsoft.KeyVault(VaultName=kv-prod,SecretName=db-conn)
  3. C
    https://kv-prod.vault.azure.net/secrets/db-conn
  4. D
    @KeyVault(VaultName=kv-prod;SecretName=db-conn)

Answer

The correct reference format is '@Microsoft.KeyVault(VaultName=kv-prod;SecretName=db-conn)' because it uses the correct prefix, encloses the parameters in parentheses, and separates the VaultName and SecretName parameters with a semicolon.
The correct option is the one specifying '@Microsoft.KeyVault(VaultName=kv-prod;SecretName=db-conn)'. In Azure App Service, Key Vault references in application settings must start with the '@Microsoft.KeyVault' prefix, enclose the properties in parentheses, and use a semicolon as the delimiter between key-value pairs like VaultName and SecretName.

Step-by-Step Solution

1
Identify the required prefix for Key Vault references in Azure App Service application settings.
The prefix must be '@Microsoft.KeyVault'.
Azure App Service parses application setting values starting with '@Microsoft.KeyVault' to retrieve secrets at runtime.
2
Determine the parameter format when referencing a secret by the vault name and secret name.
The syntax requires 'VaultName=vault-name;SecretName=secret-name' inside the parentheses.
Parameters must be specified using key-value pairs separated by a semicolon.
3
Construct the final reference string with the given vault 'kv-prod' and secret 'db-conn'.
'@Microsoft.KeyVault(VaultName=kv-prod;SecretName=db-conn)'
This matches the requirements of prefix, parameter names, semicolon separator, and parentheses wrapping.

Key Concept

Azure Key Vault references in Azure App Service Application Settings
Estimated Time:45s
Rate this question