You are deploying a Java Spring Boot application to an Azure App Service (Linux). The application loads its configuration settings from an Azure App Configuration store using the Spring Cloud Azure App Configuration library. The App Configuration store contains a key named `/application/payment-gateway-key` configured as a Key Vault reference that points to a secret in an Azure Key Vault named `kv-payment-prod`. A system-assigned managed identity is enabled on the App Service. When the application starts, it throws an authorization exception while trying to resolve the Key Vault reference.
Which of the following configurations is required to successfully resolve the secret value at runtime?
- AUpdate the /application/payment-gateway-key key in the Azure App Configuration store to use the value @Microsoft.KeyVault(SecretUri=https://kv-payment-prod.vault.azure.net/secrets/GatewayKey) and set the content type to application/json.
- BGrant the App Service's system-assigned managed identity the App Configuration Data Reader role on the Azure App Configuration store, and grant the Azure App Configuration instance the Key Vault Secrets User role on the Azure Key Vault.
- Grant the App Service's system-assigned managed identity the App Configuration Data Reader role on the Azure App Configuration store, and grant the same identity the Key Vault Secrets User role on the Azure Key Vault.Cevap
- DEnable a user-assigned managed identity on the Azure App Configuration store, grant it the Key Vault Administrator role, and associate that user-assigned identity with the App Service.
Cevap
The correct configuration requires granting the App Service's system-assigned managed identity the App Configuration Data Reader role on the App Configuration store and the Key Vault Secrets User role on the Key Vault.
The correct answer is the configuration where the App Service's system-assigned managed identity is granted App Configuration Data Reader on the App Configuration store and Key Vault Secrets User on the Key Vault. The client application provider library loads the Key Vault reference metadata (specifically the URI) from the App Configuration store and then connects directly to the Key Vault to resolve the secret value using its own managed identity. Thus, the App Service identity needs read access to both resources.
Adım Adım Çözüm
Anahtar Kavram
Azure App Configuration Key Vault Reference Resolution Process