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
- 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.
- VPN (Virtual Private Network) – any free VPN like Zenmate.
Get added with the Zenmate extension from your browser. For reference, look below.
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.
- New
- Compute
- Windows Server 2012 R2 Datacenter.
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.
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.
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
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,
Click "Save" to download the RDP file.
Click on "Open" to open the downloaded RDP file.
Click on "Connect" now for connecting the Remote Desktop Connection.
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.
Click on "Yes" to accept the certificate’s request.
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”
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.
To check for the HTML file, open it on a browser.
Step 8
Let’s configure DNS for our application, using Public IP Addresses.
Dashboard - More Services - under networking look for Public IP Addresses.
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.
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.
Enter the Name, Routing Method as Geographic, select the Subscription, select the existing Resource Group and click on Create.
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.
Step 11
Add endpoints by adding the target resource type of both the IP with the Country region.
Add the target for PIP, Select the location of grouping it under regional.
Repeat the same procedure of Step 11 for creating the second endpoint and choose the regional grouping as Asia and Country as Hong Kong.
Now click on the DNS name of the Traffic Manager profile to reach the hosted application based on the region.
As am trying to access the application from Chennai, am routed towards South Indian DC.
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.
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.