Share via


How to Setup Traffic Manager on Microsoft Azure

In this article, we will learn about how to setup Azure Traffic Manager with Web App. Traffic Manager supports Web App & Cloud Service to manage to the traffic running on different datacenters across the world. 

Microsoft Azure Traffic Manager allows you to control the distribution of user traffic to your specified endpoints, which can include Azure cloud services, websites, and other endpoints. Traffic Manager works by applying an intelligent policy engine to Domain Name System (DNS) queries for the domain names of your Internet resources.

Azure Traffic Manager will help

  • Geo-route incoming traffic to your app for better performance and availability
  • Improve app availability with automatic failover
  • Increase your app’s responsiveness
  • Enable smooth cloud migration
  • Distribute your app traffic equally or with weighted values
  • Seamlessly combine on-premises and cloud systems
  • Reduce application downtime
  • Improve app performance and content delivery

Prerequisites

You will learn

  • How to Create Web App
  • How to Create App Service Plan
  • Configuration of Traffic Manager
  • Load Balancing Methods available for Traffic Manager

We will create three web app & host in three different datacenters or regions. With the help of traffic, the manager will associate all three web app. A user will type web app address in a browser at that time in backend traffic manager automatically will check all the possibility & run the web app according to methods.

Step 1: Navigate to Azure Management Portal & Sign in with Azure Subscription credentials.

Step 2: Click on +New -> COMPUTE -> WEB APP -> QUICK CREATE

Enter URL like webappname-region for understanding purpose only. Ex.wa-eastus

First Web App in East US is created successfully

Step 3: Now download the Publish Profile of this website upload one index page on Azure. Here we will upload one image & one HTML page.

1st Web App – East Us – index.html

http://wa-eastus.azurewebsites.net

For uploading html or any file on Azure different options available like any FTP Client (FileZilla) or File Explorer also will work here.

After uploading image and HTML web app will display like as below:

Step 4: Now again create second web app with new app service plan and a new region or location.

2nd Web App - Japan West - index.html

http://wa-japanwest.azurewebsites.net/


Step 5: Same as second please create a third Web App in North Europe region or location.

3rd Web App – North Europe – index.html

http://wa-northeurope.azurewebsites.net/

Step 6: Click first web app change select SCALE tab. Change the App Service Plan Tier from FREE TO STANDARD and save the settings.

Same steps perform for the two remaining web app.

Note: Only Standard web app are eligible for Traffic Manager.

Step 7: Scroll down the Azure feature and select TRAFFIC MANAGER. Create a new Traffic Manager profile.

+ New -> NETWORK SERVICES -> TRAFFIC MANAGER -> QUICK CREATE -> Enter DNS prefix of traffic manager and choose LOAD BALANCING METHODS. Currently the three load balancing methods available: Performance, Round Robin / Priority, Failover.


**
**

Available Traffic Manager Profiles

Performance – Use this method when your endpoints are deployed in different geographic locations and want to use the one with the lowest latency. When this method is used, ATM will send users to the region where he or she will get the best performance. This prevents situations where, for example, a user who is in the Central US region is directed to a site running in West Europe.

Round Robin /Weighed – Use this method when you want to distribute traffic equally across a set of endpoints. This method will evenly distribute traffic across the endpoints configured in your ATM profile using a round robin load balancing methodology. You can use this method, for example, to “ramp up” traffic to a particular endpoint without allowing it to receive all of your traffic immediately. (In the future, ATM will include enhanced functionality to make this kind of scenario even easier to configure.)

Failover – Use this method when a primary endpoint is selected to serve all the traffic but backups are required in case the primary or the backup endpoint go offline. The endpoints can be in the same data center or in different data centers. This method will redirect traffic to a secondary region if there is a problem in the primary region. For example, you may have a site in a “backup” region that doesn’t handle any traffic unless your primary site is offline for some reason.

Traffic Manager current status will be inactive because we cannot set up any Endpoint.

Step 8: Open traffic manager then chooses ENDPOINTS tab and click ADD ENDPOINTS.

Change Service Type to Web App because we are working with Web App. If you have created Cloud Service, then select Cloud Service as a service type.

All Standard tier web apps listed here. Select Service endpoints.

Wait for few minutes to configure all endpoints or refresh the page after some time.

**Step 9:**Now open traffic manager URL dnsname.trafficmanager.net in browser. 

Ex. wa-atm.trafficmanager.net

We selected Performance load balancing methods so it will check all the options and then one of the web app with region name will open.

Another way for testing Traffic manager how it will work. Open https://www.whatsmydns.net/

  • Enter trafficmanager address
  • change to CNAME
  • Click Search button

Congratulations you have successfully configured Traffic Manager with Web App on Azure!