You can change the configuration of the distribution mode by modifying the load-balancing rule in the portal.
Sign in to the Azure portal and locate the resource group containing the load balancer you wish to change by clicking on Resource Groups.
In the load balancer overview screen, select Load-balancing rules under Settings.
In the load-balancing rules screen, select the load-balancing rule that you wish to change the distribution mode.
Under the rule, the distribution mode is changed by changing the Session persistence drop-down box.
The following options are available:
None (hash-based) - Specifies that successive requests from the same client can be handled by any virtual machine.
Client IP (two-tuple: source IP and destination IP) - Specifies that successive requests from the same client IP address are handled by the same virtual machine.
Client IP and protocol (three-tuple: source IP, destination IP, and protocol type) - Specifies that successive requests from the same client IP address and protocol combination are handled by the same virtual machine.
Choose the distribution mode and then select Save.
Use PowerShell to change the load-balancer distribution settings on an existing load-balancing rule. The following command updates the distribution mode:
Set the value of the LoadDistribution element for the type of load balancing required.
Specify SourceIP for two-tuple (source IP and destination IP) load balancing.
Specify SourceIPProtocol for three-tuple (source IP, destination IP, and protocol type) load balancing.
Specify Default for the default behavior of five-tuple load balancing.
Prerequisites
If you prefer to run CLI reference commands locally, install the Azure CLI. If you're running on Windows or macOS, consider running Azure CLI in a Docker container. For more information, see How to run the Azure CLI in a Docker container.
If you're using a local installation, sign in to the Azure CLI by using the az login command. To finish the authentication process, follow the steps displayed in your terminal. For other sign-in options, see Sign in with the Azure CLI.
When you're prompted, install the Azure CLI extension on first use. For more information about extensions, see Use extensions with the Azure CLI.
Run az version to find the version and dependent libraries that are installed. To upgrade to the latest version, run az upgrade.
Use Azure CLI to change the load-balancer distribution settings on an existing load-balancing rule. The following command updates the distribution mode: