App Gateway, ASEv3 and 2 or more app services with custom domain

André Krijnen 0 Reputation points
2023-03-13T07:38:50.3433333+00:00

Hello All,

I am trying to build an App Service Environment with an Application Gateway in front. The ASE is set up with iLB.

I want the ASE to host between 2 and 4 App Services with the same Custom Domain. Each App Service will host it's own Configuration to make sure to spread the load at different backend services.

The problem is, when I add the Custom Domain to one of the App Services it cannot be added to a different one. When I set the Backend Settings with overriding the Host Name it does not matter.

How can I achieve this?

Thank you in advance.

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
962 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,921 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Andriy Bilous 10,976 Reputation points MVP
    2023-03-13T13:45:48.4833333+00:00

    Hello @André Krijnen

    One DNS record should be pointing to one App Service, it could be too complicated to have same custom domain in multiple App Services in the same region.

    In order to do this in the same region is a bit more challenging as the only way is to make sure your App Service goes to a different webspace (https://learn.microsoft.com/en-us/azure/app-service/app-service-plan-manage#move-an-app-to-another-app-service-plan). So basically to make sure it goes to a different webspace you need to create a new Resource Group and a new App service Plan, then you can 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.

    Links:
    https://stackoverflow.com/questions/65200778/running-same-custom-domain-in-different-azure-app-services-in-same-region
    https://learn.microsoft.com/en-us/answers/questions/202552/running-same-custom-domain-in-different-azure-app


  2. brtrach-MSFT 15,256 Reputation points Microsoft Employee
    2023-03-17T03:35:39.8866667+00:00

    @André Krijnen We received a notification about a negative survey and wanted to step in to see if we can assist you further. We are striving to get you to provide a positive survey rating as these surveys directly impact our team and ultimately, we want to ensure we provide you with the best experience possible.

    Backend pools were not built to allow multiple apps of the same custom domain name to be hosted in the same ASE. The intended purpose of backend pools is for customers who run multiple web apps within their ASE. This way they can assign backend pool 1 to APP1, backend pool 2 to APP2, etc.

    The benefit in that situation is that if APP1 experiences high resource consumption or maybe even going offline due to the resource consumption being so high, APP2 will not be impacted. It's resource consumption of CPU, memory, etc. will not be impacted along with its overall uptime.

    I do agree with @Andriy Bilous that trying to host the same custom domain name (contoso.com) in the same region will lead to you trying to sort out webspaces, which can become a management task.

    Now you can use a custom domain suffix for your apps. For example, set the ILB ASE domain name to contoso.com and then give APP1 the custom domain name of app1.contoso.com and APP2 to app2.contoso.com. Based on what you shared though, I do not believe this is what you are looking for.

    With that being said, you can use an App Gateway to direct traffic to the individual apps. This is likely your best solution. https://learn.microsoft.com/en-us/azure/app-service/environment/integrate-with-application-gateway

    Would you be willing to share more details on your use case? Why would you not direct all of your traffic into the same app/backend pool if all apps are the same and resolving to the same custom domain name? The app pools themselves can scale up/out to provide powerful hardware and many instances that should be able to support most if not all workloads.

    I hope this reply helps to provide clarity and I hope you will consider proving an updated survey. If you have further questions, please respond to this message so we can assist you further.