Resiliency Options in Azure — Part 1

Tanveer Ahmed
7 min readJul 7, 2021

Hello Everyone , Today we are going to look into the resiliency options in Azure , In this post we will be looking into Azure Traffic Manager which is used in distributing traffic generated from a client to the service (Endpoint) .

If an application is used throughout the globe , deploying the app in just a single location can lead to performance degradation as the user request can be initiated from anywhere around the world , if the distance between the app location and the user is too far it affects the performance of the application as the latency increases. There are other several factors to be looked upon when we strategies the deployment of an application which we will talk about in this post.

Azure Traffic Manager

It is a DNS based traffic load balancer which helps to distribute traffic from a client to a rule based identified endpoint .
It uses traffic routing method(more on this ahead) to direct requests to the appropriate service endpoints, there are several benefits of Azure traffic manager which includes applications availability , increase performance of the application , Geo-Fencing etc and even for complex deployment we can use Nested traffic manager profiles (more on this later).

Below diagram represents how our traffic manager would look like (We are using priority based in the example)

For our demo we would be using a web app which will be deployed in two regions , one will server as a primary region and the second will be deployed to a failover region, once we have deployed our web app we need to create the traffic manager profile

Steps to create a traffic Manager profile in Azure

  1. Go to Azure Portal , Click on Create a resource -> Traffic Manager Profile and then click create
  2. Fill the fields as per following image

Note:- we have selected Routing method as Priority , following options are available in case of Routing method field():-

Priority
Performance
Weighted
Geographic
Multi-value
Subnet

We will discuss more on Performance, Weighted and Geographic routing method in more details in next section.

Once we have the traffic manager policy we can now add endpoints to which the client requests will be directed based on priority (since we selected priority as our routing method) .

To add the endpoints follow the below steps:-

  1. Open the traffic manager profile you had created in the previous step.
  2. Go to Endpoints tab
  3. Click on create , fill the fields as per below and then click on Add button.

Note:- We have selected the first deployment which we performed at East US region , the priority selected is 1 which means all the traffic will be redirected to this deployment , unless we have a failure in the region. In case of failure the traffic will be sent to the priority 2 region and when priority 2 region goes down the traffic is then redirected to the priority 3 region and so on.

To add the endpoint for priority 2 region we add the endpoint from step 1–3 with values for priority and resource to be 2 and <AppNameAtWestUS> respectively.

To see this is action , browse to the DNS name of the traffic manager profile , and you will notice that it takes us to the default website we created, Now disable the East US region endpoint in the traffic manager profile (the priority 1 endpoint) and then again browse to the DNS name of your traffic manager profile you will see that you are still able to browse to the website , although this time the traffic was redirected to the secondary region but an an end user you would not be able to see that.

We can add more no of priorities based on the number of regions the app is deployed .

Types of Routing Methods

In this section we cover in more detail about some of the routing methods .

Priority

In case of priority routing method a primary endpoint is defined in the traffic manager profiler where all the requests are redirected (priority is set to 1 while adding the end-point) , you can add one or more endpoint with different priorities (2,3,4 etc) , if the service is not available (disabled)at priority 1 the client request is then redirected to the subsequent priority endpoint and if the subsequent priority endpoint is also not available the request will be redirected to the next available priority endpoint and so on .

Below Diagram represents how priority based traffic manager profile looks like.

Weighted

In case of weighted traffic routing the traffic redirection happens based on the weight of the endpoints. Let us say we have 5 endpoints , weighted 20,80,30,10,70. The one with the weight set at 70 will have highest chance of receiving the traffic and one with weight set to 10 will have the lowest chance of receiving the traffic.

This case is mostly used in case you want to gradually upgrade traffic to an endpoint after the deployment is done. Lets say you deployed the service to a location and you want to make sure it is working as expected and only expose the service to very few users , to achieve this we set the value to the lowest among all endpoints (10 in the mentioned example) and once you observe that you are good to expose the service to more number of users you can gradually increase the weightage (this can be done through portal , PowerShell, PowerCLI etc).

Below Diagram depicts how the Weighted traffic routing method works:-

Performance

Performance based routing uses the latency table (which it maintains) to decide where the traffic needs to be redirected . When a traffic is recieved to the traffic controller it redirects the traffic to the endpoint with lowest latency (which is generally but not necessarily the nearest location from the IP address of the source )

below picture depicts the working of performance based routing method.

If you look at the latency table in the diagram , for each IP range there is a latency in ms (millisecond) recorded, traffic manager will look at the IP source and check which IP range it is on , based on the IP range it determines which Endpoint has the lowest latency and directs the traffic to the identified endpoint.

This method is very useful when you have users around several geographical regions and you are dealing with performance critical applications.

Geographic traffic-routing method

This method of routing is useful in case of data sovereignty rules, localisation of content (for example a paid up video streaming service will have different set of contents for US users and different for India users).

In Case of Geographic traffic-routing method the redirection of traffic happens based on the source IP’s geographic location . The grouping can be done on basis of Regional Grouping (Like Africa, APAC etc) , Country, states etc.

It is commonly seen that geographic traffic-routing method is used in a nested format . below example diagram shows one of the use case in nested traffic routing geographic method is a parent routing method to the priority based traffic routing method.

You might have observed that there seems to be similarity between performance based and geographic routing , however with Geographic routing you have custom options to create your own rule to redirect the traffic.

Using Geographic-Routing can be very useful if combined with performance routing (Nested Routing), for example lets say we have application deployed in US , India (North South , East, West) , Brazil ,Japan, Australia. If the source is from North of India, at first layer the traffic is first filtered to India Region (Geographically routed) and in the latency table it is observed that the lowest latency is observed from North India Deployment hence the Traffic is finally routed to the North India Deployment.

Below diagram depicts the above scenario.

Conclusion

In this post we have discussed on what traffic manager in Azure is and the type of routing methods available , However we several other resiliency options Like Azure Front door, Application Gateway, Global Load Balancer which we are going to discuss in subsequent posts.

Thanks for Reading , Have a Great day.

--

--

Tanveer Ahmed
Tanveer Ahmed

Written by Tanveer Ahmed

Senior Systems Engineer at EPAM systems.

No responses yet