2

I'm trying to do what I think should be pretty simple, but I'm missing something. Can you take a look?

I'm in the Azure Cloud, running two web apps in different service plans, in different regions. The two apps are copies of each other.

I'm trying to use Azure Traffic Manager to fail-over from the primary region to the secondary region if the primary region goes down.

I want to be able to use the same domain name, even when the site fails over. Here is what I have so far:

Domain name is 'example.com'

  1. Set up traffic manager profile, monitoring both endpoints. Check.
  2. Set up a CNAME DNS records for wwww.example.com pointing to exampledotcom.trafficmanager.net. Check.
  3. Browse to exampledotcom.trafficmanager.net and I get routed as expected. Check.
  4. If I connect to www.example.com, Traffic Manager seems to route me to an instance, but I get the following Azure Error:

"Error 404 - Web app not found. The web app you have attempted to reach is not available in this Microsoft Azure App Service region."

This is happening because I don't have the domain name mapped to the Azure Web App. When I attempt to map the custom domain to two instances, in different regions (for fail-over purposes), Azure complains that the domain is already registered to another web app.

How can I map a custom domain to two Web Apps for fail-over purposes with Traffic Manager?

3

I spoke with Azure support. You can, in fact, bind the same domain name to two different WebApps in this scenario, provided that:

  1. They are different regions
  2. You target them with TrafficManager endpoint first.

If you don't bind the custom domain to both WebApps, you will not be able to access your site after fail-over. The WebApp will refuse the traffic if the domain name is not bound.

This is what I was told and what ended up working:

  1. Create Traffic Manager profiles and add both WebApps as end points. This will bind XXXX.trafficmanager.net domains to each Web App.

  2. WAIT for the domains to propagate through the Azure system and show up in the "Custom Domains" menu of the WebApps.

  3. Go to bind a custom domain name as usual, but make sure you select the XXXX.trafficmanager.net address as shown in the photo:

enter image description here

1

When I attempt to map the custom domain to two instances, in different regions (for fail-over purposes), Azure complains that the domain is already registered to another web app.

All of these are by design behavior. And it should work in this way.

If you want to through traffic manager to achieve fail-over, there is no need to set the same name of two websites. In azure, we add different domain names to traffic manager endpoints, after you complete your configuration, we should edit the DNS record on your authoritative DNS server to point your company domain name to the Traffic Manager domain name, then we can use the company domain name to access the website behind the traffic manager.

Traffic manager works like this: enter image description here

How can I map a custom domain to two Web Apps for fail-over purposes with Traffic Manager?

Two web apps, do you mean the web apps are Azure web APP service, create by azure? If yes, we can add the two web sites to traffic manager's endpoints, like this:

enter image description here

After the configuration is complete, we can use your company domain name to test the connection.

By the way, azure traffic manager work as a load balancer(DNS level), so we can use the custom domain to several websites in different regions.

  • 1
    As stated in the accepted answer, your approach will not work, because both web apps require the same 'custom domain' to be added, and Azure's DNS validation process will block the custom domain from being added to the second app (where both apps are in the same region) – Richard Hauer Aug 31 '17 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.