Managing Your Traffic On Server Applications Using Geographic Routing

Welcome to my first write-up on Azure Traffic Manager using Geographic Routing. Let’s begin with a basic introduction to Azure Traffic Manager before getting into  detail with it.

Azure Traffic Manager

Traffic Manager is used to route the traffic between your application which runs on the server machine subjected to be Windows or Linux. Here, in Traffic Manager, we have four different types of routing methods- 

  • Priority Based Routing
  • Performance Based Routing
  • Geographic Based Routing
  • Weighted Based Routing

Priority Based Routing

In Priority Based Routing, we set priorities for the servers connected with the help of Traffic Manager. The request gets routed with the help of the priorities that have been configured.

Performance Based Routing

In Performance Based Routing, you will be able to access the applications on the server machine based on the lesser time of retrieval. 

Weight Based Routing

It’s just similar to Round Robin Scheduling where you configure weightage towards each application that has been hosted on the server.

Geographic Based Routing

In Geographic Based Routing, depending on your Geographical location of access, your Traffic Manager will route the incoming connection towards the nearest geographical location of your application.

In the below demo, we will be working with Geographic based Routing in Traffic Manager. We will be creating two server machines one at South India location and the next one at Central India by which we are going to access the application based on the nearest point of access. Our end-users who will be pinging from India will be routed to South India’s DC and other requests from Hong Kong will be routed towards Central India’s DC. To create a scenario of accessing data from Hong Kong location we will be using VPN with help of Zenmate.

Let’s get on with the demo!

Requirements

  1. You should have an Azure account, if not click here to get an Azure account which will be a free trial one for a month.
  2. VPN (Virtual Private Network) – any free VPN like Zenmate.

Get added with the Zenmate extension from your browser. For reference, look below.

Azure Traffic Manager

Follow the below step by step procedure.

Step 1

Login to the Azure account of yours by clicking here.

Click on New - Compute - Windows Server 2012 R2 Datacentre.

  1. New
  2. Compute
  3. Windows Server 2012 R2 Datacenter.

    Azure Traffic Manager

Step 2

You will be getting four blades as Basics, Size, Settings, and Purchase which you have to configure for creating a new Virtual Machine.

For Basics,

  • Name: Enter your Virtual Machine name.
  • VM disk type: Select your Virtual Machine Disk Type either as HDD or SDD.
  • Username: Mention the login username for your server.
  • Password: Password for your server.
  • Confirm Password: Confirm the same as previous.
  • Subscription: Select the active subscription of the one which you own.
  • Resource Group: Either create a new resource group or select the existing one which you have.
  • Location: Your preferred Datacenter Location, here we have selected South India.

Click on OK to move to the next blade.

Azure Traffic Manager

Step 3

Select the size for your Virtual Machine; I have selected A1 based on my usage. Click on "Select" to move on to the next blade of Settings.

Azure Traffic Manager

Step 4

Configure your NSG (Network Security Group) settings by adding an inbound rule which sets a priority, source, source tag, service, protocol, port range and action. Click on OK followed by it.

  • Name – Internetrule
  • Priority – 200
  • Source – Tag
  • Source Tag – Internet
  • Service – Custom
  • Protocol – TCP
  • Port range – 80
  • Action – Allow

Azure Traffic Manager

Azure Traffic Manager

Click on "Purchase" after validation on the final blade of summary.

Note

Repeat the above steps of 1-4 to create another instance on the DC location of Central India.

Step 5

Connect towards your Virtual Machine using the connect option which will download the RDP file or using the Public IP Address as shown below,

Azure Traffic Manager

Click "Save" to download the RDP file.

Azure Traffic Manager

Click on "Open" to open the downloaded RDP file.

Azure Traffic Manager

Click on "Connect" now for connecting the Remote Desktop Connection.

Azure Traffic Manager

Click on "More Choices", use a different account and connect with the help of credentials which you gave at the time of creating the Virtual Machine.

Azure Traffic Manager

Click on "Yes" to accept the certificate’s request.

Azure Traffic Manager

Step 6

Now, the Virtual Machine has been logged in; look for PowerShell tool located at the Taskbar. Install IIS using the below command.

Add-WindowsFeature –Name “Web-Server”

Azure Traffic Manager

Step 7 Repeat this step for both the server’s deployed at different zones.

After the installation has been completed go to the directory address of C:/inetpub/wwwroot/iis.html

Open up IIS html file with help of notepad. On your HTML scripts at body add the location of your Data Centre to distinguish between the different zones where the data is coming from.

  • For CIS VM - <h1>Central Indian Server</h1>
  • For SIS VM - <h1>South Indian Server</h1>

Save the file now.

Azure Traffic Manager

To check for the HTML file, open it on a browser. 

Azure Traffic Manager

Step 8

Let’s configure DNS for our application, using Public IP Addresses.

Dashboard - More Services - under networking look for Public IP Addresses.

Azure Traffic Manager

Configure the name for both the Public IP Addresses under Configuration and save it.

Note

DNS names should be always unique and it should be with lower cases. 

Azure Traffic Manager

Step 9

Create a Traffic Manager Profile by clicking on new and search for the same. Click on the Traffic Manger Profile and click Create.

Azure Traffic Manager

Enter the Name, Routing Method as Geographic, select the Subscription, select the existing Resource Group and click on Create.  

Azure Traffic Manager

Step 10

Set DNS time interval on the Configuration blade and configure the failover endpoints. Configure the Probing interval, Tolerated number of failures and Probe timeout. Click on Save after configuring it.

Azure Traffic Manager

Step 11

Add endpoints by adding the target resource type of both the IP with the Country region.

Azure Traffic Manager

Add the target for PIP, Select the location of grouping it under regional.

Azure Traffic Manager

Repeat the same procedure of Step 11 for creating the second endpoint and choose the regional grouping as Asia and Country as Hong Kong.

Azure Traffic Manager

Now click on the DNS name of the Traffic Manager profile to reach the hosted application based on the region.

Azure Traffic Manager

As am trying to access the application from Chennai, am routed towards South Indian DC.

Azure Traffic Manager

Let’s check if we are routed back to Central Indian Server, by enabling the VPN in the browser and setting the location to Hong Kong and access it with help of the DNS name on Traffic Manager.

Azure Traffic Manager

Note

As we have used geo-mapping based on specific geo location, accessing the application from any other location other than India or Hong Kong will get a "DNS not found" error.

Conclusion

Here, we are done with Traffic Manager using Geographic routing. 


Similar Articles