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 may be handled by any virtual machine.
Client IP (source IP affinity two-tuple) - Specifies that successive requests from the same client IP address will be handled by the same virtual machine.
Client IP and protocol (source IP affinity three-tuple) - Specifies that successive requests from the same client IP address and protocol combination will be handled by the same virtual machine.
Choose the distribution mode and then select Save.
Note
This article uses the Azure Az PowerShell module, which is the recommended PowerShell module for interacting with Azure. To get started with the Az PowerShell module, see Install Azure PowerShell. To learn how to migrate to the Az PowerShell module, see Migrate Azure PowerShell from AzureRM to Az.
Use PowerShell to change the load-balancer distribution settings on an existing load-balancing rule. The following command updates the distribution mode:
If you prefer, install the Azure CLI to run CLI reference commands.
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 additional sign-in options, see Sign in with the Azure CLI.
When you're prompted, install Azure CLI extensions 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: