Search code examples
azureazure-active-directoryazure-web-app-serviceazure-front-door

Azure front door error 404 with app service backend


I have a web application using AAD authentication and is deployed in a app service. It works fine when I browse the app service. I was verifying its behavior along with a azure front door(classic). But soon as I deploy front door with this web app as the back end it starts to give a 404 error.

I am browsing the frontend host and it resolves to mywebapp.azurewebsites.net/Home/Error

No webpage was found for the web address https://mywebapp.azurewebsites.net/Home/Error
HTTP ERROR 404

Also, redirect uri set up is as below:

https://mywebapp.azurewebsites.net/
https://mywebapp.azurewebsites.net/signin-oidc
https://myappfrontdoor.azurefd.net/
https://myappfrontdoor.azurefd.net/signin-oidc
https://localhost:{myport}/
https://localhost:{myport}/signin-oidc

Solution

  • I have created web application using AAD authentication and deployed in an App service like below:

    enter image description here

    Added identity provider with AAD authentication like below:

    enter image description here

    Created Azure front door classic with backend pool associated with app service like below:

    enter image description here

    In routing rule select accepted protocol as HTTP and HTTPS Make sure to select Frontend/domain like below:

    enter image description here

    Now, when I try to browse the frontend host it resolve successfully like below:

    enter image description here

    enter image description here

    If still error persists:

    • Check that your web application's authentication settings are configured correctly. Specifically, make sure that the redirect URIs in your Azure Active Directory app registration match the URLs that you have specified in Azure Front Door.
    • When I attempted, I received the same 404 error when using RDP view the frontend while signed into the account it resolves successfully after a while, the connection is resolved in a regular browser.
    • Ensure that routing rules should specify the correct path-based routing rules for your web application