Kodez | Your trusted consulting partner.
April 13, 2020

Azure Traffic Manager Failover on Websites

Azure Traffic Manager is a DNS-based load balancer. In this blog post, we show how Traffic Manager can be configured to provide resilience and high-availability to Azure Wep Apps.

Azure Traffic Manager Failover on Websites

Azure Traffic Manager is a DNS-based load balancer. In this blog post, we show how Traffic Manager can be configured to provide resilience and high-availability to Azure Wep Apps.

In summary, here’s how Azure Traffic Manager works normally.

  1. Alice browse to a domain name URL https://example.azurewebsites.net
  2. Browser resolves domain name to IP address using DNS service
  3. DNS service checks with Azure Traffic Manager - what is the IP Address of example.azurewebsites.net?
  4. Azure Traffic Manager responds with IP Address and flows back to browser.
  5. Browser fetches page from application server.
  6. Alice sees the rendered page on the browser.

Azure Traffic Manager periodically polls for web app health. Upon detection of degradation of performance, Traffic Manager will direct traffic to the healthy web app.

Create Azure Traffic Manager and Endpoints

  • Create Azure Traffic Manager from Azure Portal. As shown in the remarks, Traffic Manager is not bound to any location and is a global.
  • After Traffic Manager is created, does not redirect traffic to any of the web applications. The screenshot below shows how to create an endpoint that points to an App Service
  • Created two endpoints to two app services; one in Australia East and and another in Australia Southeast.
  • Confirmed traffic manager is working by visiting the traffic manager URL.
  • DIG traffic manager URL shows it resolves to the first app service failover-1.

Testing the failover

  1. Stop app service failover-1
Stop app service failover 1

2. Confirm app-service stopped.

How to create Azure Traffic Manager from portal

3. Traffic Manager WORKS - page works normally.

How to create Azure Traffic Manager from portal

4. Traffic Manager WORKS - DIG shows traffic manager resolves to failover-2.

NOTES

  1. Expect slight seconds of delay between the failover between appservice by Traffic Manager.
  2. All browsers cache DNS resolution results; thus end-users will continuously experience failed site until the DNS resolution cache is cleared. DNS resolution cache duration differs between all major browsers.



Kodez | Cloud. DevOps. AI. Mobility.