You are deploying an Azure App Service web application that must retrieve a database connection string from an Azure Key Vault without modifying the application code. You plan to configure an application setting in App Service to reference the Key Vault secret directly. The secret is located at the URI: https://contosovault.vault.azure.net/secrets/dbconn/f3b890. Which syntax format must you use for the App Service application setting value to reference this secret?
- @Microsoft.KeyVault(SecretUri=https://contosovault.vault.azure.net/secrets/dbconn/f3b890)Cevap
- B@Azure.KeyVault(SecretUri=https://contosovault.vault.azure.net/secrets/dbconn/f3b890)
- C@Microsoft.KeyVault(SecretUrl=https://contosovault.vault.azure.net/secrets/dbconn/f3b890)
- Dhttps://contosovault.vault.azure.net/secrets/dbconn/f3b890
Cevap
The syntax prefixing the secret's URI with @Microsoft.KeyVault(SecretUri=...) is correct.
The correct answer is the syntax prefixing the URI with @Microsoft.KeyVault(SecretUri=...). When App Service detects this pattern, it resolves the secret from Key Vault on behalf of the application using the application's managed identity.
Adım Adım Çözüm
Anahtar Kavram
Azure Key Vault Reference Syntax in App Service