Azure Traffic Manager Implementation Best Practices

What Is Azure Traffic Manager?

Azure Traffic Manager Implementation Best Practices

Azure Traffic Manager is a tool used to control user traffic dissemination of the service endpoints at various data centers. It is a DNS rooted load balancer that can facilitate all or any of the Azure global regions and provide the maximum level of availability and receptivity for your services.

As an external DNS solution, Azure Traffic Manager broadens the utility of DNS beyond simple name IP resolution by including load balancing and advanced features like weighted performance name resolution and geo fencing.

Based on the routing arrangement, Azure Traffic Manager selects an endpoint. Azure Traffic Manager supports a range of routing procedures to suit the various application needs. Once the endpoints are selected, the client is directly connected to the correct service point. It also has automatic fault tolerance and provides endpoint health updates. Additionally, the traffic manager constructs an extremely available application adaptable to failure, including the collapse of an entire Azure zone.

How Does Azure Traffic Manager Work?

Azure Traffic Manager favors four traffic routing methods to implement network traffic routing to the different service endpoints. The traffic manager implements the traffic routing procedure to every DNS query it receives. The routing method decides which endpoint returns the DNS response.

Azure Traffic Manager has four traffic routing methods available for implementation.

  • Priority: You will select this method when you want to implement a primary service endpoint for all traffic and provide a backup when primary endpoints are unavailable.
  • Weighted: You will select this method for implementation when you have to disseminate traffic among several endpoints, either evenly or based on weights defined by you.
  • Performance: This routing method is implemented when the endpoints are in different geographic locations, and you want the closest endpoint to be used by the users for the least network latency.
  • Geographic: You will implement this method to direct end users to particular endpoints like Azure, Nested, or External. Implementing the geographic method depends on the geographic location from where the DNS query originated.

Every Traffic Manager profile includes observation of endpoint health and automatic fault detection. A singular Traffic Manager profile uses one traffic routing procedure. So you can implement different traffic routing procedures for your profile at any point in time. Changes are applied almost immediately with no downtime.

Implementing Azure Traffic Manager Best Practices

Traffic Routing Method - Priority

In most cases, an organization wants to ascertain reliability for the services it offers by implementing more than one backup option for its primary service. Azure allows its customers to implement the failsafe pattern easily with a priority traffic routing method.

There is a priority list of service endpoints in the Traffic Manager profile. By default, all the traffic is routed to the primary endpoint. In case the primary endpoint is not available, the Traffic Manager routes the traffic through the secondary endpoint. If both the endpoints are unavailable, it is routed through the next endpoint. Endpoint availability is based on how many endpoints are enabled or disabled and continuous endpoint monitoring.

Azure Resource Manager helps you configure the endpoint priority by implementing the priority property for each endpoint. However, setting this property is optional.

Traffic Routing Method - Weighted

This traffic routing method enables you to distribute traffic equally or to a pre defined weighting. When you configure a weighted traffic routing method, you assign a weight to every endpoint in the Traffic Manager profile.

Implementing weight in the Traffic Manager is assigning an integer from 1 to 1000. This parameter assignment is, however, optional. If omitted, the Traffic Manager uses the default weight of 1. Priority is based on higher weight.

When you implement the weighted method, it enables some useful options:

  • Gradual application upgrade – In this scenario, you assign a percentage of the traffic to a new endpoint and then gradually increase the traffic to 100%.
  • Application migration to Azure – Here, you create a Traffic Manager profile with external endpoints and Azure. Now adjust the weight of these endpoints to give access to new endpoints.
  • Cloud bursting for extra capacity – Rapidly expand an on premise implementation into the cloud by setting it behind the Traffic Manager profile. When extra capacity is needed in the cloud, you can enable or include more endpoints and specify the portion of traffic to be routed through them.

Azure Resource Manager supports the arrangement of the weighted traffic routing. You can arrange the weights using the Resource Manager versions of CLI, Azure PowerShell, and the remaining APIs.

It would help if you remembered that DNS reactions are cached by clients and by the iterative DNS servers used by them to resolve DNS names. The caching may have an effect on the weighted traffic dissemination. When the client number and repetitive DNS server are large, traffic dissemination works as expected. However, caching can distort the traffic distribution when the number is small.

Traffic Routing Method - Performance

With performance traffic routing, you can deploy endpoints in multiple locations across the globe. This results in improved responsiveness of many applications since the traffic is routed through your nearest location.

The closest or nearest endpoint location does not necessarily mean the closest in terms of demographic distance. Rather, the performance traffic routing implementation assesses the nearest endpoint by measuring network latency. The Traffic Manager follows an Internet Latency Table to keep a round trip trail between each Azure datacenter and IP address ranges.

The Traffic Manager searches for the IP address of the incoming DNS request in the Internet Latency Table. Next, it selects an available endpoint in the Azure datacenter with the lowest latency for the particular IP address range and then returns that said endpoint in the DNS response.

As mentioned earlier, Traffic Manager does not receive any DNS queries straight from the client. Instead, the DNS inquiries come from the iterative DNS service that the clients use. Hence, an IP address used to ascertain the nearest endpoint is not the IP address used by the user but the IP address of the iterative DNS service.

The traffic manager updates the Internet Latency Table to keep track of the changes in the new Azure regions and the global internet regularly. However, the performance of the applications differs based on the real time differences in load across the internet.

Performance traffic routing never monitors the load on a given service endpoint, but if the endpoint is not available, Traffic Manager removes it from the DNS query response.

Points to remember:

  • When you are using a performance traffic routing procedure with nested endpoints or external endpoints, you will have to mention the location of the said endpoints. Select the Azure region nearest to your deployment based on the values supported by the Internet Latency Table.


  • In case there are multiple endpoints in the same Azure region in your profile, the Traffic Manager distributes the traffic equally among the endpoints of the same region. If you want a different traffic distribution, you will have to use a nested Traffic Manager profile.


  • If all the active endpoints in the nearest Azure region are downgraded, the Traffic Manager shifts traffic to the endpoints in the next nearest Azure region. If you want to set your own fail over sequence, use nested Traffic Manager profiles.


  • When there are repeated DNS queries from the same client, traffic is directed to the same endpoints. The algorithm behind the endpoint selection is deterministic. While travelling, clients use various recursive DNS servers and they may be routed to different endpoints. Endpoints can also be affected because of any update in the Internet Latency Table. Hence, the performance traffic routing method can never guarantee that a client is routed to a particular endpoint.

Traffic Routing Method - Geographic

In the Geographic traffic method, you can arrange the Traffic Manager profiles in such a way that users are directed to particular endpoints based on the geographic location from where the DNS query originated. This allows Traffic Manager customers to enable layouts where knowing a customer’s geographic location and routing traffic based on location is essential.

When a traffic profile is set for geographic routing, every endpoint associated with the profile needs to have a set of geographic regions attached to it. A geographical region can be:

  • World – All region
  • Regional grouping – such as Africa, Australia/Pacific region, Middle East, etc.
  • Country/Region – Like Brazil, Peru, Ireland, etc.
  • State/Province – Like Australia(Queensland), USA(California), Canada(Alberta), etc. (Note: the regional granularity is supported only for states/provinces of Canada, Australia, USA, and the UK.)

When a set of regions or any region is assigned to an endpoint, all requests originating from those regions get routed to the said endpoint. The Traffic Manager uses the originating IP address of the DNS query to locate the region from which a user is querying. As said earlier, this is the IP address of the local DNS resolver.

The Traffic Manager interprets the source IP address of the DNS query to determine the geographic location. Next, it looks up an endpoint mapped to the geographic location in question. This lookup starts from the lowest state/province level (wherever applicable) to the highest level, the world. The first match found using this process is designated as the endpoint to return as a response to the query.

The following points apply to this method:

  • When the routing type is geographic routing, you can map only a single geographic region to the endpoint in the Traffic Manager Profile.
  • Suppose a particular user region comes under two different endpoints. In that case, the geographic mapping Traffic Manager selects the endpoint with the lowest granularity and does not consider routing requests to other endpoints from that region.
  • As you know that you can map a region to one endpoint, the Traffic Manager returns it irrespective of the endpoint is healthy or not.
  • If the query originates from a region that is not mapped in the profile, in that case, the Traffic Manager returns a NODATA response. Hence it is strongly recommended that customers implement geographic mapping with one endpoint.

Azure Traffic Manager Best Practices Conclusion

Azure Traffic Manager implementation does not receive DNS inquiries straight from the client. Instead, it comes from the iterative DNS service that the client is connected to. Hence the IP address used to locate the region is not the client IP address but the IP address of the iterative DNS service.

Once the Azure Traffic Manager is implemented by selecting one of the several traffic routing methods, you will get continuous monitoring of endpoint health and automatic endpoint fault detection.

Avatar for Hitesh Jethva
Hitesh Jethva

I am a fan of open source technology and have more than 10 years of experience working with Linux and Open Source technologies. I am one of the Linux technical writers for Cloud Infrastructure Services.

0 0 votes
Article Rating
Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x