You are configuring a secure architecture where an Azure API Management (APIM) instance gateway forwards client requests to a backend API hosted on an Azure App Service. The backend App Service is configured to require Microsoft Entra ID authentication and expects an OAuth token. You want to authenticate the APIM instance to the backend App Service using its system-assigned managed identity. Which two actions should you perform? (Choose two.)
- Enable the system-assigned managed identity for the APIM instance.Answer
- Add the <authentication-managed-identity resource="https://myapi.azurewebsites.net" /> policy to the <inbound> section of the APIM policy.Answer
- CAdd the <authentication-managed-identity resource="https://myapi.azurewebsites.net" /> policy to the <outbound> section of the APIM policy.
- DConfigure a user-assigned managed identity on the backend App Service and grant the APIM instance access to it.
- EConfigure a Key Vault access policy to allow the backend App Service to retrieve the APIM instance client secret.
Answer
Enable the system-assigned managed identity for the APIM instance, and add the authentication-managed-identity policy with the resource URI to the inbound section of the APIM policy.
To authenticate to a backend service using a managed identity, you must first enable the system-assigned managed identity on the APIM instance. This enables the instance to request tokens from Microsoft Entra ID. Next, you must place the <authentication-managed-identity> policy in the inbound section of the APIM policy to request and attach the Entra ID token to the backend request.
Step-by-Step Solution
Key Concept
Authenticating APIM with backend services using managed identity