Load Balancer — Azure

Chetaspatil
3 min readSep 27, 2019

--

Azure load balancer is a Layer 4 (TCP/UDP) service which is use for failover or high availability.

Fig. Azure Load Balancer

What is Load Balancer?

Load balancing is used when you want high availability by spreading incoming request across multiple virtual machines. An Load Balancer is a Layer 4 (TCP/UDP) which forwards request to only healthy VM’s. It continuously monitors the specific port of VM using health probe to check if VM is operational or not.

Virtual Machines connects to load balancer using Virtual Network Interface Card (NIC). Virtual NIC has a IP address attached to it using which load balancer will forward request to that VM. Load balancer uses a backend address pool where it will find the IP address of VM.

How Load Balancer Works?

Load Balancer is a kind of deployment where the load balancer’s IP address is the one which is advertise to the client web app, so whenever a request is sent from client it will include the IP address of load balancer.

Fig . Load Balancer

As you can see in the figure the load balancer is the first one called by client. Before making the load balance decision it also performs Network Address Translation (NAT) on the request packet, changing the recorded destination IP address from its own to that of the content server it has chosen on the internal network, and also before forwarding the response from server to client it updates the packet header from server’s IP address to its own.

How to create a load balancer in Azure?

Step 1: Click on create a resource

Step 2 : Click on Networking

Step 3 : Click on load balancer

Step 4: Select Subscription and fill up following information

Step 5 : Review + Create it. Then go to All Resources and select you load balancer.

Step 6 : Clicking on load balancer you will see this screen

Step 7 : Click on Backend pool. To distribute traffic to the VMs, the load balancer uses a back-end address pool. The back-end address pool contains the IP addresses of the virtual network interfaces (NICs) that are connected to the load balancer.

Step 8 : To allow the load balancer to monitor VM status, you use a health probe. The health probe dynamically adds or removes VMs from the load balancer rotation based on their response to health checks. You can create a health probe and attach rule to VM for using that health probe for monitoring of VM’s Health.

--

--