You are configuring Azure API Management (APIM) to route requests to a secure backend Azure Function app. The backend function app requires Microsoft Entra ID authentication. You enable a user-assigned managed identity on the APIM instance, which has a client ID of `11111111-2222-3333-4444-555555555555`. You must configure APIM to authenticate against the backend function using this user-assigned managed identity. You define the following policy configuration:
xml
<policies>
<inbound>
<base />
<authentication-managed-identity resource="https://my-backend-function.azurewebsites.net" />
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
</outbound>
</policies>
When you test the API, requests to the backend fail with an HTTP 401 Unauthorized status. Which of the following modifications to the policy definition will resolve this issue?
- AMove the authentication-managed-identity element to the outbound section and add the client-id="11111111-2222-3333-4444-555555555555" attribute.
- BOmit the resource attribute in the inbound section to allow the policy to default to the function app's audience and use the system-assigned identity context.
- Add the client-id="11111111-2222-3333-4444-555555555555" attribute to the authentication-managed-identity element in the inbound section.Answer
- DModify the policy to use the identity-id attribute pointing to an Azure Key Vault secret reference to retrieve the secret credentials of the identity.