Last Update: Sep 04, 2024 | Published: Jan 07, 2019
Two Azure App Services websites/plans have been deployed:
It is the responsibility of the dev/operator to duplicate the app service/web app content from app service in North Europe to the app service in West Europe. This could be done via the publishing or DevOps mechanism(s), or via an app service extension.
The Traffic Manager Profile is a DNS abstraction mechanism that is hosted globally in Azure. Clients will browse to the DNS name of the profile, via a CNAME alias for their website URL, and the profile will direct them to the production or failover site, depending on the situation.
To create a Traffic Manager profile, click Create a Resource in the Azure Portal, search for and select Traffic Manager Profile, and click Create. Enter the following information in the Create Traffic Manager Profile blade:
The globally hosted Traffic Manager Profile will be created in a resource group that does have a single location. I take no chances with “how things should work in a regional outage” – I recommend placing the resource group in a “witness region”, or a third region that will be independent of the production and failover regions. In my example, I am deploying the resource group for Traffic Manager into France Central.
An endpoint is any place that Traffic Manager can redirect traffic to. In our case, those endpoints will be App Services that are deployed into North Europe and West Europe.
To add an endpoint, open the Traffic Manager Profile, browse to Settings > Endpoints, and click + Add. An Add Endpoint blade appears; enter the following information into this blade:
The typical blog post you will see online will tell you to set up two endpoints:
In theory, Traffic Manager will:
However, there are two issues:
My preferred approach is to take control of the failover as follows:
I can now use a process, such as Azure Automation, to enable the Secondary endpoint and disabled the Production endpoint; this will give me full control over the failover and allow me to orchestrate failover of other components of the solution, such as Azure SQL.
If you open the Traffic Manager Profile and browse to Settings > Configuration, you will find a number of settings for changing the behaviour of the profile, including:
Because I have taken control of failover, I am just interested in DNS Time To Live (TTL). This determines how often clients of the website will need to resolve the name of the website to be redirected by Traffic Manager. The longer this is, the longer a site might appear offline after failover; the default is 60 seconds.
The new traffic manager profile has an Internet-resolvable domain name in the form of <profilename>.trafficmanager.net, which you can see in Overview or Properties. Copy this name and create a CNAME record for your desired website URL. In my example, the DNS domain is hosted in Azure – Azure DNS is a global service, but the resource group is also in the witness site of France Central.
Now if a user browses www.joeelway.com, the name will redirect to tm-petridrmgmt.trafficmanager.net, and the Traffic Manager Profile will redirect this lookup to the active endpoint … so the possible customer browses the site that I determine should be online.