A company requires that all requests routed from Azure API Management (APIM) to a backend Azure App Service be authenticated using Microsoft Entra ID. You create a user-assigned managed identity named `apim-backend-identity` and link it to the APIM instance. You must configure the APIM policy so that it automatically requests an OAuth token using the user-assigned identity and includes it in requests to the backend service. How should you configure the APIM policy?
- AConfigure the `<authentication-managed-identity>` policy inside the `<outbound>` section of the API policy, specifying both the backend API's resource URI and the client ID of the user-assigned managed identity.
- BConfigure the `<authentication-managed-identity>` policy inside the `<inbound>` section of the API policy, specifying only the backend API's resource URI and omitting the client ID or identity ID.
- Configure the `<authentication-managed-identity>` policy inside the `<inbound>` section of the API policy, specifying both the backend API's resource URI and the client ID of the user-assigned managed identity.Cevap
- DImplement a `<set-header>` policy inside the `<inbound>` section that retrieves credentials from Azure Key Vault using the `@Microsoft.KeyVault(...)` reference syntax, without configuring access policies for the managed identity.
Cevap
Configure the `<authentication-managed-identity>` policy inside the `<inbound>` section of the API policy, specifying both the backend API's resource URI and the client ID of the user-assigned managed identity.
To authenticate requests to a backend API using a user-assigned managed identity, you must configure the `<authentication-managed-identity>` policy within the `<inbound>` section. Because a user-assigned identity is used, you must explicitly provide the client ID or identity ID of that identity. This allows the API Management gateway to successfully request a token for the specified resource and attach it to the request sent to the backend.
Adım Adım Çözüm
Anahtar Kavram
Securing backend services in Azure API Management using user-assigned managed identities.