A developer deploys a web application to an Azure App Service Web App. The developer configures an application setting named DbPassword to reference a secret in Azure Key Vault. The syntax of the reference is verified as correct. However, at runtime, the application cannot retrieve the password and displays an authorization error. Which of the following is the most likely cause of this error?
- The App Service Web App's managed identity has not been granted Get secret permissions in the Key Vault access policies.Cevap
- BThe Key Vault reference in the application settings is configured using a system-assigned managed identity, which is unsupported for resolving Key Vault secrets.
- CThe DbPassword application setting value is missing the mandatory @Microsoft.KeyVault prefix wrapper.
- DThe autoscale rules for the App Service Web App are configured with conflicting thresholds, causing the app instance to reboot before retrieving the secret.
Cevap
The App Service Web App's managed identity has not been granted Get secret permissions in the Key Vault access policies.
The correct answer is correct because Azure App Service requires the web app's managed identity (either system-assigned or user-assigned) to have GET secret permissions on the Azure Key Vault access policies to successfully resolve Key Vault references at runtime. Without this permission, the app cannot retrieve the secret value.
Adım Adım Çözüm
Anahtar Kavram
Key Vault references in Azure App Service allow web apps to retrieve secrets using managed identities, which requires proper access policies (GET permissions) on the Key Vault.