You are configuring a web app named `app-payments` on Azure App Service to retrieve database credentials from Azure Key Vault. You have created a user-assigned managed identity named `id-payments` and granted it GET permissions on the Key Vault secrets. You have also assigned `id-payments` to `app-payments` and added the app setting `DbConnectionString` with the value `@Microsoft.KeyVault(SecretUri=https://myvault.vault.azure.net/secrets/dbconn/)`. However, the web app fails to resolve the Key Vault reference at runtime.
Which configuration must you apply to resolve this issue?
- ACreate a Key Vault access policy that explicitly grants the App Service App Service Plan access to the secrets.
- Set the App Service application setting `keyVaultReferenceIdentity` to the resource ID of the user-assigned managed identity.Cevap
- CUpdate the `DbConnectionString` app setting value to `@Microsoft.KeyVault(Identity=id-payments;SecretUri=https://myvault.vault.azure.net/secrets/dbconn/)`.
- DConfigure the App Service to use a system-assigned managed identity and grant it GET permissions on the Key Vault.
Cevap
Set the App Service application setting `keyVaultReferenceIdentity` to the resource ID of the user-assigned managed identity.
To use a user-assigned managed identity for Key Vault references in Azure App Service, you must explicitly set the `keyVaultReferenceIdentity` app setting to the resource ID of the user-assigned managed identity. This tells App Service which identity to use when resolving the `@Microsoft.KeyVault` references.
Adım Adım Çözüm
Anahtar Kavram
Configuring Azure App Service Key Vault references with a user-assigned managed identity.
Tahmini Süre:1m 30s