![Azure for Architects](https://wfqqreader-1252317822.image.myqcloud.com/cover/608/36700608/b_36700608.jpg)
Public load balancing
In this configuration, load balancers are assigned a public IP address. Assigning a public IP address ensures that the load balancer can accept requests coming in from the internet. Without a public IP address, it is not possible to access the resource from the internet. The load balancer can be configured with load balancing rules. Load balancing rules work at the port level. It accepts source and destination ports map them together such that whenever a load balancer receives a request for the source port, the request is forwarded to a virtual machine from a group of virtual machines attached to the load balancer on the destination port. This is shown in the following diagram:
![](https://epubservercos.yuewen.com/D01160/19470402408930506/epubprivate/OEBPS/Images/58692a04-b154-4672-808b-08b3714c0977.png?sign=1738926744-QqhUd5BjvVymPNm6qfgXjhYyNUTUvMTa-0-f4902d26330fbf641c9a2c373bae4fd0)
But how does this entire thing work? How is a public IP address assigned to a load balancer? What does the load balancer contain? How is it configured with load balancer rules? How does the load balancer send requests to the virtual machines? How does the virtual machine know that it is attached to the load balancer and more? The answer to all these questions is visible in the following diagram.
In this configuration, the load balancer is assigned a public IP address. The load balancer is accessible from the internet and can accept client requests. The load balancer can be configured with load balancing and NAT rules. Both NAT and load balancing rules are part of the frontend configuration. The frontend configuration sends client requests to one of the IP address available in the backend pool. These IP addresses are associated with the network interface card, which in turn is attached to virtual machines.
![](https://epubservercos.yuewen.com/D01160/19470402408930506/epubprivate/OEBPS/Images/5f2a252f-c034-4e1b-9d46-5b1d4142c5a3.png?sign=1738926744-Ay0DQPSqFkygdZPXHnO6VZ0ix0YLRIhD-0-5329f830f0d0f2a7754c1e956bbfe8fd)