An organization is securing a backend REST API by routing requests through Azure API Management (APIM). The backend API requires an API key in the request header for authorization. You store this API key as a secret in Azure Key Vault.
You need to configure APIM to retrieve this secret from Key Vault using a user-assigned managed identity named `apim-kv-identity`. You have already associated the user-assigned identity with the APIM instance.
Which configuration should you implement to retrieve the secret and pass it to the backend service?
- Grant the user-assigned managed identity `apim-kv-identity` GET permissions on Key Vault secrets. In APIM, create a named value referencing the Key Vault secret URI and specify the user-assigned identity. In the <inbound> policy section, use the <set-header> policy to reference the named value.Cevap
- BGrant the APIM system-assigned managed identity GET permissions on Key Vault secrets. In APIM, create a named value referencing the Key Vault secret URI and specify the system-assigned identity. In the <inbound> policy section, use the <set-header> policy to reference the named value.
- CGrant the user-assigned managed identity `apim-kv-identity` GET permissions on Key Vault secrets. In APIM, create a named value referencing the Key Vault secret URI and specify the user-assigned identity. In the <outbound> policy section, use the <set-header> policy to reference the named value.
- DIn APIM, create a named value referencing the Key Vault secret URI and specify the user-assigned identity. In the <inbound> policy section, use the <set-header> policy to reference the named value. Do not configure any additional access policies or roles on Key Vault, as associating the identity with APIM automatically grants access.
Cevap
Grant the user-assigned managed identity `apim-kv-identity` GET permissions on Key Vault secrets, configure a named value in APIM referencing the Key Vault secret URI using that user-assigned identity, and use the `<set-header>` policy in the `<inbound>` section to reference the named value.
The correct configuration uses the user-assigned identity to securely fetch the backend API key secret from Key Vault via an APIM named value, and uses the `<set-header>` policy in the inbound section to add the key to the request sent to the backend. This ensures the key is protected in Key Vault and only retrieved when processing requests.
Adım Adım Çözüm
Anahtar Kavram
Securing backend services with Azure API Management using User-Assigned Managed Identity and Key Vault secret references in inbound policies.