What is Traffic Manager?
Traffic Manager is a service provided by Azure to balance the end user traffic load of services like web app, cloud service or VMs across multiple instances or endpoints, hosted in azure. It enables to define the routing policies for services hosted in Azure and traffic redirected according to the policies. It also improves the availability and performance of applications. Traffic manager is a DNS-based service; it is not a proxy or a gateway and does not see the traffic passing between the client and the service.
For more information about traffic manager like how it works and why you should use. Please refer article Azure Traffic Manager Part-1
Step by Step Configuration of Azure Traffic Manager
Step 1: Deploy three instances of service in three different regions
Create three web apps across three different regions as follows
mywebapp-us.azurewebsites.net for US region
mywebapp-eu.azurewebsites.net for Europe region
mywebapp-asia.azurewebsites.net for Asia region
Asia web app page looks like follows which is standard page shown by default when web app is created , similar are the default pages of US and EU web apps.
Step 2: Create a Traffic Manager profile
Create traffic manager profile ‘mywebappsci.trafficmanager.net’, and configure it to use the ‘Performance’ traffic-routing method across the three endpoints.
On the Hub menu, click New > Networking > See all, click Traffic Manager Profile to open the Create Traffic Manager profile blade, and then click Create.
Step 3: Add App service endpoint to a Traffic Manager profile
- In the portal’s search bar, search for the Traffic Manager profile name that you want to modify, and then click the Traffic Manager profile in the results that the displayed.
- In the Traffic Manager Profile blade, in the Settings section, click Endpoints.
- In the Endpoints blade that is displayed, click Add.
Similarly create endpoints for all the web apps deployed across Asia, US and Europe.
When you create a Traffic Manager profile, Azure automatically assigns a DNS name for that profile. You can find the Traffic Manager Domain name in the General section on the Configuration page of the Traffic Manager profile.
Now traffic manager is configured properly and if you visit the URL of the traffic manager you will able to see the web part of nearest web app provided it is healthy as we have configured performance routing method here.
Step 4: Point own domain to an Azure Traffic Manager domain
Next step is to map your company domain name to traffic manager domain. For example, to point name www.mywebappsci.com to the Traffic Manager DNS name mywebappsci.trafficmanager.net. To point your company domain name to a Traffic Manager domain name, need to modify the DNS resource record on your Internet DNS server to use the CNAME record type, which maps your company domain name to the domain name of your Traffic Manager profile. You can see the Traffic Manager domain name in the General section on the Configuration page of the Traffic Manager profile.
For this tutorial i have not bought domain hence will not able to show actual configuration.
Step 5: Test if traffic manager is working fine.
To test the configuration, if traffic manager is working fine or not, we need to navigate to either traffic manager URL or the custom domain URL if you have configured the same. In my case I have not bought custom domain, hence testing with traffic manager URL.
- Make changes to the default page of web apps of each region, which we have created. I have updated default pages of web apps with map of that region on the page. if you want to know how to make changes to default page, please refer article here
e.g. Web app of Europe will look as follows.
- after making changes for all web app, lets test with traffic manager URL. I am based out of India (Asia region), hence if I try to navigate to traffic manager URL it should hit the Asia web app and show me that page. As expected it showed me page of Asia web app.
- Now let’s take testing one step further, by creating a VM in US region and testing traffic manager from the VM, as per configuration it should show the page of US web app.
If you want to know more about VMs in Azure please refer article VM in Azure
As expected following screen snap shows on left site my local machine which is in Asia region and on right side Azure VM which is in USA region.
I leave a exercise to you to test for Europe region.
Health and Parenting Inspiring Stories Technology Microsoft Azure SharePoint O365