APP service call to APIM with managed identity

Nagpal, Rita 126 Reputation points
2026-11-02T16:00:57.0166667+00:00

Hi,

We host our React application in Azure App Service using the BFF (Backend-for-Frontend) pattern. All microservices are deployed in AKS and secured through APIM. Since there are no direct browser-to-backend calls, all service requests are routed through the App Service.

Is it possible to enable a Managed Identity on the App Service, configure APIM to trust that identity, and then have the App Service call backend services using only the APIM endpoint? In this scenario, would APIM automatically acquire and attach the required access token when forwarding requests to the backend services?

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.


Answer accepted by question author
SHOUMIK CHAKRAVARTY 1,375 Reputation points
2026-11-03T05:15:28.5+00:00

Hi @Nagpal, Rita

Yes to the first question, and no to the second.

Inbound (App Service to APIM)

This works. Register an Entra application for the API, have the App Service managed identity request a token for that resource, and validate it in APIM with validate-azure-ad-token, which “enforces the existence and validity of a JSON web token (JWT) that was provided by the Microsoft Entra ... service for a specified set of principals in the directory.” List the App Service identity under client-application-ids or the API’s application ID under audiences. This runs inbound at any scope.

Outbound (APIM to AKS)

APIM does not acquire a token for you. The reference mentions it : “Token forwarding is the customer’s responsibility.” If your AKS service needs one, authentication-managed-identity “uses the managed identity to obtain an access token from Microsoft Entra ID for accessing the specified resource” and then “will set the value of the token in the Authorization header using the Bearer scheme.” APIM caches that token until it expires.

Two implications:

  • If you add that policy, the backend sees APIM’s identity rather than the App Service’s, because the policy sets the Authorization header. If you need the original caller’s identity downstream, carry it in a separate header.
  • “API Management doesn’t validate which backend the token is sent to”, so restricting which backends can receive it is on you.

If AKS does not require an Entra token, you do not need the outbound policy at all.

Help make this community better for everyone: if this answer resolved your issue, please accept it or leave an upvote. If not, share more details in a comment so we can continue the discussion and find the right solution.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.