azureload-balancingazure-application-gateway

Azure : Load Balance multiple instance of application from different VM's


I have three instance of an application in vm1 and another 3 in vm2. Each application has different context path and the URL's are below VM1 https://hostname/random1 https://hostname/random2 https://hostname/random3 VM2 https://hostname/random1 https://hostname/random2 https://hostname/random3

Is it possible to load balance them and use https://hostname/random as an external URL to reach the application.


Solution

  • You can use Azure Application Gateway.

    configure Application Gateway routing rules so that requests to https://hostname/random are distributed across the six instances of your application on VM1 and VM2

    Also, you can use Path-Based Routing rules to define your specific paths /random1, /random2, /random3) in the load balancer and route them to /random.

    Dont forget to configure the health probes to check the health of each application instance

    for more information, please check Azure Application GW

    Another solution by using a reverse proxy like Nginx to route incoming requests to your application and load balance the traffic between instances