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'
- Set up traffic manager profile, monitoring both endpoints. Check.
- Set up a CNAME DNS records for wwww.example.com pointing to exampledotcom.trafficmanager.net. Check.
- Browse to exampledotcom.trafficmanager.net and I get routed as expected. Check.
- 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?
Best Answer
I spoke with Azure support. You can, in fact, bind the same domain name to two different WebApps in this scenario, provided that:
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:
Create Traffic Manager profiles and add both WebApps as end points. This will bind
XXXX.trafficmanager.net
domains to each Web App.WAIT for the domains to propagate through the Azure system and show up in the "Custom Domains" menu of the WebApps.
Go to bind a custom domain name as usual, but make sure you select the
XXXX.trafficmanager.net
address as shown in the photo: