As you may have seen, the Cross-Region (Global) Azure Load Balancer has recently become Generally Available (10th July 2023) – https://azure.microsoft.com/en-gb/updates/azure-s-crossregion-load-balancer-is-now-generally-available/. I decided therefore to create a test and demo environment for it – whereby a quick example can be deployed to get started.
✅ For a detailed overview of Cross-Region Load Balancer, please see here: https://learn.microsoft.com/en-us/azure/load-balancer/cross-region-overview
Overview
The Cross-Region Load Balancer provides a number of key features that extend the functionality of Azure’s Load Balancers across multiple Regions, with a focus on Global Availability. The key features are:
-
Ultra Low Latency
-
IP Controls
-
Ability to scale up/down behind a single endpoint
-
High Availability
-
SLA backing
-
UDP Support
-
Floating IP
You can read more about the features in the announcement blog post here: https://techcommunity.microsoft.com/t5/azure-networking-blog/distribute-global-traffic-with-ultra-low-latency-using-azure/ba-p/3857991.
Demo Environment
To provide an environment to test the features and allow demonstration, I have written a small Lab environment in Terraform that deploys the infrastructure shown in the diagram below. The idea behind this Lab is to show how Cross-Region (Global) Load Balancing could be used to Load Balance a globally distributed Web Application that is deployed across multiple regions.
This environment provides the following:
-
Resource Groups in 3 Regions.
-
An Azure Key Vault with a Secret that’s used as the VM Admin Password.
-
3 Virtual Machines in 3 Regions with IIS installed, and a PowerShell script that sets the IIS page to the VM hostname (so we can confirm where the Load Balancer is sending us to).
-
NICs for the VMs
-
VNets, Subnets, and NSGs – note that Standard SKU Load Balancers are secure by default, so require an NSG to allow inbound access.
-
Standard SKU Public IP Addresses in 3 Regions.
-
Standard SKU Regional Load Balancers in 3 Regions.
-
A Cross-Region (Global Load Balancer) that balances traffic across the 3 Regional Load Balancers.
Once deployed, you will have a Cross-Region (Global SKU) Load Balancer deployed that can be used as the access point for testing the Lab:
Testing
Testing the environment is simple – each Regional Load Balancer has a Public IP, with a DNS Label, so you can test each Region directly. The Cross-Region (Global) Load Balancer can then be used to test access across the entire infrastructure – and shutting down servers within the environment will force this to failover to another Regional endpoint – all of which can be accessed via the Cross-Region (Global) Load Balancer endpoint.
For example, in normal operation traffic will be sent across all 3 Regions based on the configured Load Balancing Rules, however, in a situation like the below – where a Region is down, traffic would be sent to the remaining Regions, again based on the configured Load Balancing Rules:
Deployment in Terraform
Deployment of the Cross-Region (Global) Load Balancer in Terraform is simple and follows the same conventions as a Standard Load Balancer, albeit with the sku_tier set to “Global“:
# Cross Region Load Balancer resource "azurerm_lb" "cross-region-lb" { name = "cross-region-lb-${var.regions.region1.location}" location = var.regions.region1.location resource_group_name = "rg-${var.regions.region1.location}-con" sku = "Standard" sku_tier = "Global" frontend_ip_configuration { name = "PublicIPAddress" public_ip_address_id = azurerm_public_ip.pip-cr-lb.id } }
✅ I hope this environment is helpful and illustrates how and where the Cross-Region (Global) Load Balancer can be used. Thanks for reading!
Resources and further Reading:
- https://learn.microsoft.com/en-us/azure/load-balancer/cross-region-overview
- https://techcommunity.microsoft.com/t5/azure-networking-blog/distribute-global-traffic-with-ultra-low-latency-using-azure/ba-p/3857991
- https://github.com/jakewalsh90/Terraform-Azure
- https://azure.microsoft.com/en-us/pricing/details/load-balancer/