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