Hello Atanas Georgiev
We understand that you're trying to set up Azure Application Gateway to authenticate users with Microsoft Entra ID directly, without involving any backend resources for authentication.
We suggest using Azure Application Gateway in front of an Azure App Service that uses Azure Active Directory (Entra ID) authentication, but there are a few important considerations and configurations to ensure it works properly:
1.App Service is configured with Azure AD authentication (via the Authentication/Authorization blade).
2.Application Gateway acts as a reverse proxy with a public IP, forwarding traffic to the App Service.
3.Users are redirected to Azure AD login by the App Service, not the gateway.
- After login, the App Service validates the token and serves the app. Enable Azure AD authentication in the App Service. and configure the redirect URI to match the App Gateway's public domain
- Custom Domain & SSL:
- Bind a custom domain to both the App Gateway and App Service.
- Ensure SSL termination is handled properly either terminate SSL at the gateway and forward HTTP to App Service or use end-to-end SSL with a certificate on both ends.
- Rewrite Host Header:
- Use rewrite rules in Application Gateway to set the
Host
header to match the App Service domain. This is critical for Azure AD to validate the redirect URI correctly.
- Use rewrite rules in Application Gateway to set the
- Configure health probes to target a non-authenticated endpoint (e.g.,
/health
) to avoid 302 redirects to login. - For more information, please refer this article: https://techcommunity.microsoft.com/blog/appsonazureblog/setting-up-application-gateway-with-an-app-service-that-uses-azure-active-direct/392490 https://learn.microsoft.com/en-us/azure/app-service/configure-authentication-provider-aad?tabs=workforce-configuration
Hope this helps you get that resource deleted! If these answers your query, do click the "Upvote" and click " of which might be beneficial to other community members reading this thread.
If the above is unclear or you are unsure about something, please add a comment below.