Is it possible to use in Azure Application Gateway with two Web Apps using the same domain without hoste name override

743 views Asked by At

I am trying to set up in Azure an Application Gateway and two Web Apps using the same domain and same sub-domain, and the distinction is made by URL path. Something like this:

my.domain.com/app1 --->  app1.azurewebsites.net
my.domain.com/app2 --->  app2.azurewebsites.net

Now the tricky part - I do not want to use the option Override with new host name; instead, I want to add the binding for my.domain.com to both Web Apps - this is giving me an error due to a conflict.

The reasons why I want to keep the original host headers are described in this Microsoft documentation.

The only way I found to achieve my goal is to deploy both app1 and app2 on the same Web App instance in virtual directories. I would like to avoid this option because this will prevent me from scaling independently and brings some other complexities during the deployment, etc.

My question is - is my desired scenario really impossible, or did I overlook something?

many thanks for your suggestions!

Some facts I found during testing:

  • you cannot bind the same domain to two different Web Apps - Azure will reject this with a conflict error
  • Web Application will respond with an error if the host header is not matching the binding
1

There are 1 answers

1
dor On

exactly what i am facing, looks like it is kind of a limitation on the "fron end teir" of the webapps infrastructure / App service plan. i am still waiting for a confirmation but it seems like the routing (on our environment) from Azure application gateway back to the webapps is done according to the 'hostname' in the request and not according to the backend target. so i assume because both uses the same webapp infrastructure the http requests arrives to the same tiny proxy of the ASP that forward the request to the relevant webapp according to the HOST header which is what expected from a proxy to do.

i have tries to put the webpps on a different ASP and with different incoming IP but the result is the same.