title | titleSuffix | description | services | documentationcenter | author | ms.custom | ms.service | ms.devlang | ms.topic | ms.tgt_pltfrm | ms.workload | ms.date | ms.author |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Configure load balancer TCP reset and idle timeout in Azure |
Azure Load Balancer |
In this article, learn how to configure Azure Load Balancer TCP idle timeout. |
load-balancer |
na |
asudbring |
seodec18 |
load-balancer |
na |
how-to |
na |
infrastructure-services |
10/09/2020 |
allensu |
[!INCLUDE updated-for-az]
[!INCLUDE cloud-shell-try-it.md]
If you choose to install and use PowerShell locally, this article requires the Azure PowerShell module version 5.4.1 or later. Run Get-Module -ListAvailable Az
to find the installed version. If you need to upgrade, see Install Azure PowerShell module. If you're running PowerShell locally, you also need to run Connect-AzAccount
to create a connection with Azure.
Azure Load Balancer has an idle timeout setting of 4 minutes to 120 minutes. By default, it is set to 4 minutes. If a period of inactivity is longer than the timeout value, there's no guarantee that the TCP or HTTP session is maintained between the client and your cloud service. Learn more about TCP idle timeout.
The following sections describe how to change idle timeout settings for public IP and load balancer resources.
$publicIP = Get-AzPublicIpAddress -Name MyPublicIP -ResourceGroupName MyResourceGroup
$publicIP.IdleTimeoutInMinutes = "15"
Set-AzPublicIpAddress -PublicIpAddress $publicIP
IdleTimeoutInMinutes
is optional. If it isn't set, the default timeout is 4 minutes. The acceptable timeout range is 4 to 120 minutes.
To set the idle timeout for a load balancer, the 'IdleTimeoutInMinutes' is set on the load-balanced rule. For example:
$lb = Get-AzLoadBalancer -Name "MyLoadBalancer" -ResourceGroup "MyResourceGroup"
$lb | Set-AzLoadBalancerRuleConfig -Name myLBrule -IdleTimeoutInMinutes 15
Internal load balancer overview