Learn how to perform geo-load balancing for deployments in different Azure regions using Traffic Manager profiles in Azure Resource Manager (ARM) or Cloud Solution Provider (CSP) subscriptions.
I have deployed two web farms, one in the North Europe Azure region and one in West US Azure region. I want to use Traffic Manager to unify both of these installations with geo-load balancing so that I have:
Note that this is a simple example; I could have deployed web farms in many Azure regions.
An endpoint is the public connection to some service that you want to load balance. For example, a web farm will have a DNS name/IP address combination.
You must configure a DNS name for any Azure resource that you want to use as an endpoint. I have configured the public IP address of my web farms with DNS names (under Settings > Configuration):
Now my web farms can be browsed using the Microsoft-owned and -managed domain names.
Open the Azure Portal and click New. Search for Traffic Manager and click Traffic Manager profile (also found under Networking).
Give the Traffic Manager profile a name; note that this will become the domain name for the unified web service, spanning both sites. Select the subscription and either create a new resource group or use an existing one – I suggest creating a new resource group in an Azure region that your service is not running in if disaster recovery is a part of your design.
There are three routing methods that you can choose from:
Choose a routing method to create the Traffic Manager profile. I am going to use Performance, meaning that both sites are available (for DR) and clients will be directed to the best performing web farm.
You can alter the default configuration of a Traffic Manager profile in Settings > Configuration. You can modify:
Now you need to tell Azure which endpoints will be load balanced by Traffic Manager. Browse to Settings > Endpoints in the Traffic Manager profile and click Add. Here you can add:
Give the endpoint a name, ideally consistent with the resource that is your endpoint.
Azure supports types of Azure endpoints:
I am load balancing Azure virtual machines so I selected the Public IP option.
Select or enter the details for the endpoint. My endpoints are Azure public IP addresses, so I select the public IP address of my first web farm. I can add the new endpoint as disabled to allow me to add it to the set before I bring it into production.
Repeat this process for each endpoint.
Copy the domain name of the Traffic Manager profile, petridemo.trafficmanager.net in my case, and try to browse to it in your browser. You should find that you are routed to one of your web farms.
If this is the first time you’re using Traffic Manager or you are testing a new deployment, then you might want to opt for the priority model and modify the priorities of the endpoints to verify that both (or more) locations are operational.
Remember that your client will cache the routing (DNS looking) of the resolved endpoint for the number of seconds in the configuration of the profile.
You can monitor the status of your Traffic Manager implementation in the Overview blade of the profile.