I am trying to make a call to the APIM endpoint in Azure from the function app using the Managed Identity of the function app. Not sure if there is any article I could take a reference from?
CodePudding user response:
I believe you can do it using validate-jwt policy. The policy will look like this:
<validate-jwt header-name="Authorization" failed-validation-httpcode="401" failed-validation-error-message="Unauthorized. Access token is missing or invalid.">
<openid-config url="https://login.microsoftonline.com/{aad-tenant}/v2.0/.well-known/openid-configuration" />
<required-claims>
<claim name="aud">
<value>{backend-api-application-client-id}</value>
</claim>
</required-claims>
</validate-jwt>
CodePudding user response:
You should apply this policy type: https://docs.microsoft.com/en-us/azure/api-management/api-management-authentication-policies#ManagedIdentity
