top of page

The Magical Mystery Tour of Traffic Manager Routing Methods

  • Writer: joe parr
    joe parr
  • Aug 5, 2024
  • 4 min read

Firstly, what is Azure Traffic manager.


Simply put, it is a globally available, DNS based, load-balancing service that helps traffic distribution across globally facing public applications. It uses DNS to direct users to specific endpoints.


I'm not going to get into the weeds with Traffic Manager, but I will try and explain the different routing methods, usage examples, then dive into a little more complex example.


Priority

Utilising the priority method gives you the flexibility of choosing which endpoint your traffic hits.


You may have a primary endpoint that you have scoped for production.


Powerful SKU.


Zonally redundant.


Etcetera, Etcetera.



Sorry, you can my drift. Production environment, tends to have more performance.


You want to make sure your users hit that endpoint. You may have a backup endpoint in case of a disaster, though it is not scoped for production, you still want it there, just in case, so setting a priority ensures you hit the primary.


Weighted

This method gives you the opportunity to weight traffic across multiple endpoints. The endpoints may be identical or perform the same task.


You may have multiple endpoints that you want to service equally, you can distribute the traffic across a set of endpoints based on a defined weight.


Performance

Performance based routing is for when you have a set of global users accessing an application that is deployed globally, and you want users to get the best experience or best performance.


Now, let’s say you are based in the US you will get better performance when accessing resources deploying in the US than you would in the UK, so by selecting this routing method, users will get directed to the endpoints with the best performance and obviously direct you to others if an endpoint is unhealthy.


Geographic

Geographical based routing is when you need to route traffic from specific geographies to specific backends. You are effectively geo-fencing your users.


An example of this is that there could be a data sovereignty requirement and you need to ensure users from the UK for example only go to UK based endpoints or it could be used to give different geographies a different user experience.


Multi-value

With this, you can only specify external endpoints, however, instead of returning a single, healthy endpoint, it will retry without the need for another DNS call.


You may have availability sensitive applications that want to minimize the downtime.


Subnet routing method

A method for shovelling your internal users to a particular endpoint and your external customers to another, this is where you can set specific subnets to hit specific endpoints.


You may be testing a new version of an application and want a subset of users accessing it.


What you want to look at is having an endpoint that isn't mapped to a subnet, acting as a catch-all if you will. This will still allow users coming from outside defined subnets access to the Traffic Manager endpoints.


Now for the fun bit...


Nested Profiles

Each profile specifies one of the previously mentioned routing methods, however, what if you wanted to first route via geography and then through performance.


This is where nested profiles come into play.


You can start to combine the benefits of more than one routing method. You can only have a maximum of 10 nested layers with no loops!


What you can start to configure is the "MinChildEndpoints".


This defines what the minimum number of healthy endpoints are for the nested profile's status to be healthy.


I would like to share an example of what this may look like.


Say you have a multi-region deployment of an application; you want to ensure your global set of users get the best experience.


You may have a Traffic Manager Profile, configured with performance routing.


The core subset of your users is UK based and you have a primary and secondary within that region, however you have a small set of users across the globe that have a single endpoint.

This example has an intial performance routing method defined so that users hit the most performant endpoint, however, within the UK South it has a secondary endpoint deployed for redundancy.


This is a small example of what is possible. like I previously mentioned you can go 10 nested layers deep to get the right routing methods for your environment.


Infrastructure-as-Code

With most of my blogs I will try and share how to configure the blog topic within Terraform and Azure Bicep.


Each method can be defined as Geographic, Weighted, Performance, Priority, Subnet and Multivalued


Terraform

resource "azurerm_traffic_manager_profile" "example" {
  name                   = random_id.server.hex
  resource_group_name    = azurerm_resource_group.example.name
  traffic_routing_method = "Weighted"
...
}

Azure Bicep

resource symbolicname 'Microsoft.Network/trafficmanagerprofiles@2022-04-01' = {
name: 'string'
location: 'string'
properties: {...
trafficRoutingMethod: 'Weighted'
...}

Hopefully this sheds a bit of light on the various routing methods within Traffic Manager. As I have shown, you can mix and match each profile to ensure the traffic is


Thanks for reading!


{

 “SignOff”: {

“Cheers”: “THF”

}

}


 
 
 

Opmerkingen


Post: Blog2 Post

©2022 by TheHumanFirewallBlog. Proudly created with Wix.com

bottom of page