Leandro Andrade Leandro Andrade -4 years ago 84
ASP.NET (C#) Question

How to map multiple custom domains on Azure to the same server, but different URL?

Say I have the following scenario:

3 different dommains


  • www.domaina.com

  • www.domainb.com

  • www.domainc.com



But I have only one AppService:


  • myserver.azurewebsites.net



which is a MVC application and I have three different websites which points to the following URLs:


  1. myserver.azurewebsites.net/WebSiteA

  2. myserver.azurewebsites.net/WebSiteB

  3. myserver.azurewebsites.net/WebSiteC



I want to map it in a way where trafic from domains A, B and C to reach respectively my application routing WebSiteA, WebSiteB and WebSiteC.

This is the first time I am trying to achieve something like this.
I was wondering, is the Azure DNS zones the way to go, or is there a way to do it directly on my domain manager panel(in this case GoDaddy)?
If so, would you please give me a simple example on how to achieve this?

OBS: I will create all this mappings and routings on the fly, so a solution coupled to my code will not work.

Answer Source

If you don't have a strict restriction on creating a new web app. I suggest you create new web apps for WebSiteB, WebSiteC, and they share the same app service plan with WebSiteA, because all web apps inside the same service plan share the resources of the plan. Let's say you will have

myservera.azurewebsites.net
myserverb.azurewebsites.net
myserverc.azurewebsites.net

Next, you can create CNAME record to map your custom domains to each web app.

I hope this helps.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download