An API gateway implemented via Azure API Management (APIM) needs to forward requests to a backend microservice secured by Microsoft Entra ID. The APIM instance is configured with a user-assigned managed identity named `apim-identity`. The backend service expects an Entra ID access token from this specific managed identity. Which policy configuration should you apply to authenticate requests using this user-assigned managed identity?
- APlace the <authentication-managed-identity resource="api://backend-app-id" client-id="00000000-0000-0000-0000-000000000000" /> policy inside the <outbound> section of the API policy XML.
- Place the <authentication-managed-identity resource="api://backend-app-id" client-id="00000000-0000-0000-0000-000000000000" /> policy inside the <inbound> section of the API policy XML.Cevap
- CPlace the <authentication-managed-identity resource="api://backend-app-id" /> policy (omitting the client-id attribute) inside the <inbound> section of the API policy XML.
- DConfigure a <set-header> policy in the <inbound> section to retrieve the managed identity's client secret from Azure Key Vault using the {{secret-key-reference}} syntax.
Cevap
Place the authentication-managed-identity policy with the specified resource and client-id attributes inside the inbound section of the API policy XML.
The correct answer configuration places the `<authentication-managed-identity>` policy in the `<inbound>` block, specifying the target backend application's audience scope via the `resource` attribute, and the `client-id` of the user-assigned managed identity. This configuration correctly retrieves the token prior to the request forwarding phase and instructs API Management which specific user-assigned identity to utilize.
Adım Adım Çözüm
Anahtar Kavram
Defining backend authentication policies in Azure API Management using user-assigned managed identities.