On Azure, using a Virtual IP may not enable traffic to be resolved to the active node as many infrastructure layers are abstracted in the cloud environment. To resolve this issue, an Internal Load Balancer should be used to forward traffic to the active node.
As an example, let us assume there are two nodes (10.20.1.10 and 10.20.2.10), working as a cluster and a virtual IP 10.20.0.10 is created that points to the active node.
In this case, an Azure Load Balancer is created with a Frontend IP address of 10.20.0.10 and a Virtual IP address with the same IP address 10.20.0.10 is created.
This ensures the client always connects to the load balancer first via the Virtual IP address 10.20.0.10.
The load balancer uses a health probe to determine which node is currently hosting the application, and all client connections are forwarded to that active node.