Front door 404 error multiple web apps

Kieran Haycock 0 Reputation points
2023-12-07T13:47:16.0233333+00:00

Firstly my problem is very similar to this https://learn.microsoft.com/en-us/answers/questions/1194782/front-door-404-error with some differences.

I have multiple webs that we want to serve using front door like this:

https://customdomain.custom.com/app1

https://customdomain.custom.com/app2

I have configured front door to have the custom domain User's image

Also created a origin group for each app like this:User's image

For each app we remove the "Origin host header" because we want the headers to use the custom domain and not the web apps url that azure generate.User's image

If I add the custom domain onto a single web app then this works as expected. However, because I have multiple web apps that need to use the same custom domain I get this error because the domain is already in use:

User's image

If I remove the custom domains from both apps I get the 404 like the post linked above.

Is there a way to use the same domain on multiple web apps? I don't see an issue with this but it doesn't allow for you a reason.

Any help is appreciated.

Thanks.

Azure Front Door
Azure Front Door
An Azure service that provides a cloud content delivery network with threat protection.
729 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,205 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Sina Salam 16,281 Reputation points
    2023-12-08T04:59:38.64+00:00

    Hello Kieran Haycock

    Welcome to the Microsoft Q&A and thank you for posting your questions here.

    To validate and summarize your question, you would need a way to use the same domain on multiple web apps. Sorry for all the stress and what you have gone through. This is a common problem though; it is not recommended to have the same custom domain in multiple App Services in the same region. This is because custom domains are based in DNS, and only one record should be pointing to one App Service. However, it is possible to have the same custom domain in different App Services in different regions.

    Alternatively, If you want to bind the same custom domain name across multiple app services within a single app service plan, you can use deployment slots.

    Each slot is a fully autonomous app service with its own configuration and settings, including custom domain. You would deploy to the staging slot, verify changes, and then swap it with the production slot without the need to change DNS.

    Alternatively, you can create a new Resource Group and a new App service Plan, then create the specific App Service and add the custom domain. In order to make sure they are in different webspaces, check if the Inbound IP is different.

    For more reading and references:

    You can read an answer similar to your question from this community: https://learn.microsoft.com/en-us/answers/questions/202552/running-same-custom-domain-in-different-azure-app

    Move an app to another App Service plan.

    Running same custom domain in different Azure App Services.

    How two set up three app services for the same domain on Azure.

    I hope this guide is helpful! Do not hesitate to let me know if you have any other questions.

    Please remember to "Accept Answer" if answer helped, so that others in the community facing similar issues can easily find the solution.

    Best Regards,

    Sina Salam


  2. brtrach-MSFT 17,166 Reputation points Microsoft Employee
    2023-12-09T01:31:11.4033333+00:00

    a

    So you would need to place your multiple web apps in different regions. This again, is largely done for redundancy and not hosting different types of web apps.

    The approach you are taking would be unusal and while it does not go against any best practices, might create more headache than its worth.

    Would you consider using a single web app with virtual directories instead? Please see here for more information: https://learn.microsoft.com/en-us/azure/app-service/configure-common?tabs=portal#map-a-url-path-to-a-directory

    Let me know if you have any questions regarding this approach.


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.