Edit

Share via


Set-AzLoadBalancerRuleConfig

Updates a rule configuration for a load balancer.

Syntax

SetByResource (Default)

Set-AzLoadBalancerRuleConfig
    -LoadBalancer <PSLoadBalancer>
    -Name <String>
    [-Protocol <String>]
    [-LoadDistribution <String>]
    [-FrontendPort <Int32>]
    [-BackendPort <Int32>]
    [-IdleTimeoutInMinutes <Int32>]
    [-EnableFloatingIP]
    [-EnableTcpReset]
    [-DisableOutboundSNAT]
    [-EnableConnectionTracking]
    [-FrontendIpConfiguration <PSFrontendIPConfiguration>]
    [-BackendAddressPool <PSBackendAddressPool[]>]
    [-Probe <PSProbe>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SetByResourceId

Set-AzLoadBalancerRuleConfig
    -LoadBalancer <PSLoadBalancer>
    -Name <String>
    [-Protocol <String>]
    [-LoadDistribution <String>]
    [-FrontendPort <Int32>]
    [-BackendPort <Int32>]
    [-IdleTimeoutInMinutes <Int32>]
    [-EnableFloatingIP]
    [-EnableTcpReset]
    [-DisableOutboundSNAT]
    [-EnableConnectionTracking]
    [-FrontendIpConfigurationId <String>]
    [-BackendAddressPoolId <String[]>]
    [-ProbeId <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Set-AzLoadBalancerRuleConfig cmdlet updates a rule configuration for a load balancer.

Examples

Example 1: Modify a load balancing rule configuration

$slb = Get-AzLoadBalancer -Name "MyLoadBalancer" -ResourceGroupName "MyResourceGroup"
$slb | Add-AzLoadBalancerRuleConfig -Name "NewRule" -FrontendIPConfiguration $slb.FrontendIpConfigurations[0] -Protocol "Tcp" -FrontendPort 3350 -BackendPort 3350 -EnableFloatingIP
$slb | Set-AzLoadBalancerRuleConfig -Name "NewRule" -FrontendIPConfiguration $slb.FrontendIpConfigurations[0] -Protocol "Tcp" -FrontendPort 3350 -BackendPort 3350
$slb | Set-AzLoadBalancer

Example 2: Modify a load balancing rule configuration to have two backend address pools

$slb = Get-AzLoadBalancer -Name "MyLoadBalancer" -ResourceGroupName "MyResourceGroup"
$MyBackendPool1 = Get-AzLoadBalancerBackendAddressPool -ResourceGroupName $resourceGroup -LoadBalancerName $MyLoadBalancer -Name $backendPool1Name
$MyBackendPool2 = Get-AzLoadBalancerBackendAddressPool -ResourceGroupName $resourceGroup -LoadBalancerName $MyLoadBalancer -Name $backendPool2Name
$slb | Set-AzLoadBalancerRuleConfig -Name "NewRule" -FrontendIPConfiguration $slb.FrontendIpConfigurations[0] -Protocol "All" -FrontendPort 0 -BackendPort 0 -BackendAddressPool $MyBackendPool1, $MyBackendPool2
$slb | Set-AzLoadBalancer

The first command gets the load balancer named MyLoadBalancer, and then stores it in the $slb variable. The second command uses the pipeline operator to pass the load balancer in $slb to Add-AzLoadBalancerRuleConfig, which adds a rule named NewRule to it. The third command passes the load balancer to Set-AzLoadBalancerRuleConfig, which sets the new rule configuration. Note that the configuration does not enable a floating IP address, which had been enabled by the previous command.

Parameters

-BackendAddressPool

Specifies a BackendAddressPool object to associate with a load balancer rule.

Parameter properties

Type:

PSBackendAddressPool[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SetByResource
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-BackendAddressPoolId

Specifies the ID of a BackendAddressPool object to associate with a load balancer rule configuration.

Parameter properties

Type:

String[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SetByResourceId
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-BackendPort

Specifies the backend port for traffic that is matched by this rule configuration.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DisableOutboundSNAT

Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EnableConnectionTracking

Configures SNAT for the VMs in the backend pool to use the publicIP address specified in the frontend of the load balancing rule.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EnableFloatingIP

Indicates that this cmdlet enables a floating IP address for a rule configuration.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-EnableTcpReset

Receive bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination. This element is only used when the protocol is set to TCP.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-FrontendIpConfiguration

Specifies a list of front-end IP addresses to associate with a load balancer rule configuration.

Parameter properties

Type:PSFrontendIPConfiguration
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SetByResource
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-FrontendIpConfigurationId

Specifies the ID for a front-end IP address configuration.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SetByResourceId
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-FrontendPort

Specifies the front-end port that is matched by a load balancer rule configuration.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-IdleTimeoutInMinutes

Specifies the length of time, in minutes, for which the state of conversations is maintained in a load balancer.

Parameter properties

Type:Int32
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-LoadBalancer

Specifies a load balancer. This cmdlet updates a rule configuration for the load balancer that this parameter specifies.

Parameter properties

Type:PSLoadBalancer
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-LoadDistribution

Specifies a load distribution. The acceptable values for this parameter are: SourceIP and SourceIPProtocol.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Name

Specifies the name of a load balancer.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Probe

Specifies a probe to associate with a load balancer rule configuration.

Parameter properties

Type:PSProbe
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SetByResource
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ProbeId

Specifies the ID of the probe to associate with a load balancer rule configuration.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SetByResourceId
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-Protocol

Specifies the protocol that is matched by a load balancer rule. The acceptable values for this parameter are: Tcp or Udp.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

PSLoadBalancer

String

Int32

PSFrontendIPConfiguration

PSBackendAddressPool

PSProbe

Outputs

PSLoadBalancer