Soru

Zorluk: OrtaConfigure Azure App Service Web Apps

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?

  1. A
    Create a Key Vault access policy that explicitly grants the App Service App Service Plan access to the secrets.
  2. Set the App Service application setting `keyVaultReferenceIdentity` to the resource ID of the user-assigned managed identity.Cevap
  3. C
    Update the `DbConnectionString` app setting value to `@Microsoft.KeyVault(Identity=id-payments;SecretUri=https://myvault.vault.azure.net/secrets/dbconn/)`.
  4. D
    Configure 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

1
Identify the authentication mechanism used for Key Vault references.
By default, Key Vault references use the system-assigned managed identity of the App Service.
Since a user-assigned managed identity is assigned, the App Service needs to know which identity to use to fetch the secrets.
2
Configure the App Service to point to the user-assigned identity.
Add an application setting named `keyVaultReferenceIdentity` with the value set to the resource ID of the user-assigned identity.
This instructs Azure App Service to use the specified user-assigned identity instead of the system-assigned identity when resolving Key Vault references.

Anahtar Kavram

Configuring Azure App Service Key Vault references with a user-assigned managed identity.
Tahmini Süre:1m 30s
Bu soruyu puanla