Introduction

Azure Traffic Manager (ATM) is a great Azure service to distribute user traffic to service endpoints in different datacenters. Different routing methods can be used:

Performance: It routes the traffic to the fastest responsive node. Priority: it routes the traffic to a specific node if the node goes down. Weighted: It routes the traffic based on the weight assigned to each node. Geographic: It routes the traffic to specific nodes based on the source location. Subnet: It routes the traffic to a specific node based on an IP address range. Multivalue: It routes the traffic to a specific number of nodes. It will return multiple IPv4 or IPv6 endpoints.

The term “Endpoints” refers to the nodes across which the traffic load balancing occurs. Endpoints can be Azure Virtual Machines, Web Apps, Cloud Services, and External non-Azure Endpoints.

Before going deeper, I just need to explain the difference between Azure Traffic Manager and Azure Load Balancer.

Azure Traffic Manager is to route the traffic globally based on defined policies. It can work across regions. Please note that Azure Traffic Manager will not “forward” the traffic. When a client requests a page or a website, the client will connect directly to the Endpoint (selected by the Azure Traffic Manager) but not through the ATM.

is to route the traffic globally based on defined policies. It can work across regions. Please note that Azure Traffic Manager will not “forward” the traffic. When a client requests a page or a website, the client will connect directly to the Endpoint (selected by the Azure Traffic Manager) but not through the ATM. Azure Load Balancer is to route the traffic inside an Azure Region but not globally! It only works with Virtual Machines in the same region.

It means that Azure Traffic Manager will route the traffic to a specific Azure Region, then when the traffic will be inside the Azure Region, the Azure Load Balancer will route the traffic to a specific Virtual Machine (local failover).

In this article, I will use two Azure Web Apps to explain how to implement Azure Traffic Manager. So, let me explain how to create an Azure Web App.

Create an Azure Web App

Azure Web Apps are the compute resources for hosting your web application. The application code runs in a managed VM so that you do not need to manage the infrastructure. The code can be in any language or framework that is supported by Azure App Service, such as:

.NET

Node.js

PHP

Java

Python

HTML

In the Azure Portal, search for “Web App“:

Then, you must enter the following information:

The Web App name

Select your Azure subscription

Select a Resource Group or create a new one

Select the operating system (Windows or Linux)

Select the Azure App Service Plan

Select the language of your application

Once the Web App is successfully created, you just have to open a browser and go to your Web App URL: to see the default home page.

You can easily deploy your website by creating FTP credentials. These credentials allow you to connect through FTP to your Web App in order to deploy your code.

So, in my case, I created:

The first Web App is called “ get-cmd1 ” and located in the US Region. I deploy a simple HTML file with basic information such as the Azure Location which is West Europe.

” and located in the US Region. I deploy a simple HTML file with basic information such as the Azure Location which is West Europe. The second Web App is called “get-cmd2” and located in the West Europe Region. I deploy a simple HTML file with basic information such as the Azure Location which is Central US.

Create an Azure Traffic Manager Profile

Now, search for the “Traffic Manager profiles” in your Azure subscription:

Click “Add” to create a new Traffic Manager profile.

Type a friendly name, select a routing method, your subscription and to finish, select a Resource Group or create a new one.

Configure ATM Profile

Traffic Manager can monitor your services to ensure they are available. Of course, it is important to configure all your Endpoint the same way. Once the profile is created, check the “Configuration” panel.

In this case, I selected “Performance” to route traffic to the fastest Endpoint. The port number is 80 and the “Path” is a custom HTML file. Note that a forward slash “/” implies that the file is in the root directory.

You can customize other fields to suit your needs.

Configure ATM Endpoints

We need to configure the Endpoints. Click “Endpoints” and “Add”:

Just a few words about Endpoints:

Azure Endpoints are used for services hosted in Azure.

are used for services hosted in Azure. External Endpoints are used for IPv4/IPv6 addresses, or, for services hosted outside Azure. These Endpoints can either be on-premises or with a different hosting provider.

are used for IPv4/IPv6 addresses, or, for services hosted outside Azure. These Endpoints can either be on-premises or with a different hosting provider. Nested Endpoints are used to combine Traffic Manager profiles to create more flexible traffic-routing schemes.

At the beginning of the article, I created two Azure Web Apps. First, I add the Web App number one:

Then, repeat the previous step to add the second Web App:

It will show you the monitor status as “Checking endpoint”. Wait a moment, and it will change the status to “Online”. At this step, both Web App are ready to receive the traffic based on the routing method.

In order to test my Azure Traffic Manager profile, I deployed a Windows 10 Virtual Machine in the Central US Region which is the same location as my second Web App. I typed the DNS name in this machine’s browser, and I confirmed that the traffic was directed to the Web App located in the Central US Region because it was closer to this machine and the network latency suited that location.

Here, you can test the “Priority” method. Add a priority number to both Web Apps:

Here, you can test the “Weighted” method. Add a weight to both Web Apps:

VSAN from StarWind eliminates any need for physical shared storage just by mirroring internal flash and storage resources between hypervisor servers. Furthermore, the solution can be run on the off-the-shelf hardware. Such design allows VSAN from StarWind to not only achieve high performance and efficient hardware utilization but also reduce operational and capital expenses. Learn more about ➡ VSAN from StarWind

Conclusion

Thanks to Azure Traffic Manager, you can “geo-route” incoming traffic to your website for better performance and availability. If you need to monitor your Azure Traffic, I advise you to use Azure Traffic View because it will help you to understand which regions have a large number of traffic.

More information about ATM pricing: https://azure.microsoft.com/en-us/pricing/details/traffic-manager/.

Thanks for reading!

Related materials:

Views All Time Views All Time 2 Views Today Views Today 9

Appreciate how useful this article was to you?

5 out of 5, based on 1 review 5 out of 5, based on 1 review

Loading... Loading...