Issue Integrating Azure Easy Auth with 2-Tier App Service (React Frontend + FastAPI Backend)

Ravi Praneeth 50 Reputation points
2025-06-17T03:57:40.6733333+00:00

We are trying to implement a 2-tier architecture using two Azure App Services:

  • Frontend: React (with MSAL)
  • Backend: FastAPI (using fastapi-azure-auth)

We’ve followed the official tutorial on Azure AD authentication for App Services: 🔗 https://learn.microsoft.com/en-us/azure/app-service/tutorial-auth-aad?pivots=platform-linux

We have completed the following steps:

  1. Enabled Azure AD-based authentication on both App Services.
  2. Assigned Managed Identities to both App Services.
  3. Registered two applications in Entra ID (one for frontend with SPA platform, and one for backend as Web API).
  4. Set the corresponding Client IDs and Redirect URIs in the App Service configurations.
  5. Used MSAL in React and fastapi-azure-auth in FastAPI for auth token validation.

Problem:

When we enable Azure Easy Auth and attach the existing identities in App Services, the built-in Easy Auth flow interferes with our custom auth logic. The token validation breaks, and communication between the frontend and backend fails.

Questions:

  1. Is it possible to integrate Azure Easy Auth with this 2-tier (React + FastAPI) architecture?
  2. Are code modifications required when Easy Auth is enabled?
  3. Can you provide any sample projects or reference links that demonstrate this setup?
  4. How do we configure authentication so that App Services and Entra ID identities work together seamlessly?

Tested Approaches:

  • Without Easy Auth: React (MSAL) + FastAPI (fastapi-azure-auth) works fine using environment-based Entra App registrations.
  • With Easy Auth enabled: Breaks the flow even though identities are attached correctly. Any guidance or clarification from Microsoft on how to properly enable Easy Auth in this type of architecture would be appreciated. We are trying to implement a 2-tier architecture using two Azure App Services:
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,934 questions
{count} votes

Your answer

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