How to configure Azure Load Balancer

How to configure Azure Load Balancer (Step by Step by Procedure ) 



  Azure Load Balancer(LB) works in Layer 4 in OSI model (Transport Layer) and acts as a single point of contact for end users. Work of LB is to distribute inbound traffic to the backend instances.


Azure LB is one of the load balancing concept in Azure we will explore APP Gateway, Traffic Manager is upcoming blog post. LB is configured with rules and these rules work at the port level to forward the traffic from source port to destination port .

Azure LB has two configuration mode 

1. Internal load balancing

2. Public load balancing 

Currently we are working on Public LB. In this mode, Load balancer(LB) is assigned with a public IP address to ensure that the LB can accept incoming request from internet and based on the configured rules it will route the incoming traffic over VM in private network. 

Procedure: 

1. I have created two VM's running Tomcat on CentOS. 

both the VM's are in same region and it should be in same network. In this example my 

network address is 172.16.0.0 

subnet for ho-webapp is 172.16.1.0 

subnet for dr-webapp is 172.16.2.0

2. Create Load Balancer , Make sure LB & VM's are in same region. 




3. To put LB into action we need to configure the below. 


Frontend IP Configuration : 

We are configuring Public LB hence Frontend IP address is assigned as shown below. 





Backend Pools: 

Is a set of VM instance or instance in a VM scale set serving incoming request. It is recommended to add more VM workload to serve the incoming traffic effectively. Adding or removing VM instance from Backend Pool and its following configuration/reconfiguration is taken care by Load Balancer . 

we have two VM instance HO-Webapp & DR-Webapp which are in different subnet and under same VNET



Health Probe:

Health probes allow Load Balancer to detect the backend pool instance status. The configuration of the health probe and probe responses determine which backend pool instances will receive new flows When a health probe fails, Load Balancer will stop sending new flows to the respective unhealthy instance. Outbound connectivity is not impacted, only inbound connectivity is impacted. 

Load Balancer health probes originate from the IP address 168.63.129.16 and must not be blocked for probes. what is Probe source IP 



Load Balancing Rules: 

A load balancing rule distributes incoming traffic that is sent to a selected IP address and port combination across a group of backend pool instances. The VM instance that the health probe considers healthy receive new traffic.


Inbound NAT Rules: 

Network address translation (NAT) is a port forwarding technique. We use NAT Rule to forward traffic from a specific port of the front-end IP address to a specific port of a back-end VM.

In the below example i have enabled SSH service in Frontend IP address to access the port 22 in target ho-webapp vm so i can connect the VM from outside network. 

You can also use custom port under service option. 


Search Results

Web result




I have enabled custom port 2222 to access the VM DR-Webapp backend port 22 for SSH. 

With this configuration Azure public loadbalancer is ready for workload. 

Reference document : Azure Load Balancer 


0 comments:

Post a Comment