Dan Mihai Patrascu
Dan Mihai Patrascu

Reputation: 192

Host 2 webapps under the same domain in Azure

Is there a way to configure same domain for multiple Azure webapps(same domain, not subdomain)?

I would like to have http://myCustomDomain.com/WebApp and http://myCustomDomain.com/WebApi where the first one is the website and second one the API.

Thanks!

Upvotes: 4

Views: 1711

Answers (2)

AVS
AVS

Reputation: 531

This would not be possible with any DNS based solution, since each webapp deployment would have an IP and same domain can't resolve to both. The DNS server can't make any decisions based on the URL (domain resolution will take place once every 5-30 minutes or so and not per request)

I have seen in work with load balancers (via IRules), but haven't seen anything similar supported for Azure Webapps. Subdomain is what people use in the absence of such fancy load balancers, but you have already ruled that out.

Upvotes: 1

4c74356b41
4c74356b41

Reputation: 72171

You would need to use virtual directories for that:

To create a new virtual application, go to the Configure tab of the Azure Web Site and go to the bottom of the page. You will see a section called “virtual applications and directories”. In here, we can create a completely separate application that runs in its own directory, with its own web.config and publishing profile.

https://blogs.msdn.microsoft.com/tomholl/2014/09/21/deploying-multiple-virtual-directories-to-a-single-azure-website/

http://www.microsofttrends.com/2015/02/02/publishing-to-azure-web-sites-with-multiple-virtual-applications/

Upvotes: 0

Related Questions