A Python-based background worker runs in an Azure Function App named func-worker-prod. The Function App needs to retrieve a database password from an Azure Key Vault named kv-secrets-prod.
You configure a user-assigned managed identity named id-worker-prod for the Function App and grant it the Key Vault Secrets User role on kv-secrets-prod. The DbPassword application setting in the Function App is currently configured as follows:
@KeyVault(SecretUri=https://kv-secrets-prod.vault.azure.net/secrets/db-password)
At runtime, the Python worker reads the DbPassword environment variable as the plain text reference string rather than the actual secret value. Which two configuration updates must you perform to ensure the Key Vault reference resolves correctly?
- Create a new application setting named keyVaultReferenceIdentity and set its value to the resource ID of the user-assigned managed identity.Answer
- Update the value of the DbPassword application setting to @Microsoft.KeyVault(SecretUri=https://kv-secrets-prod.vault.azure.net/secrets/db-password/).Answer
- CCreate a new application setting named keyVaultReferenceIdentity and set its value to the client ID of the user-assigned managed identity.
- DUpdate the value of the DbPassword application setting to @Microsoft.KeyVault(SecretUri=https://kv-secrets-prod.vault.azure.net/secrets/db-password).
- ECreate a new application setting named AZURE_CLIENT_ID and set its value to the client ID of the user-assigned managed identity.
- FGrant the user-assigned managed identity the Key Vault Contributor role on kv-secrets-prod.