Set-AzureRmLoadBalancerRuleConfig
Sets the goal state for a load balancer rule configuration.
Warning
The AzureRM PowerShell module has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.
Although the AzureRM module may still function, it's no longer maintained or supported, placing any continued use at the user's discretion and risk. Please refer to our migration resources for guidance on transitioning to the Az module.
Syntax
Set-AzureRmLoadBalancerRuleConfig
-LoadBalancer <PSLoadBalancer>
-Name <String>
[-Protocol <String>]
[-LoadDistribution <String>]
[-FrontendPort <Int32>]
[-BackendPort <Int32>]
[-IdleTimeoutInMinutes <Int32>]
[-EnableFloatingIP]
[-EnableTcpReset]
[-DisableOutboundSNAT]
[-FrontendIpConfiguration <PSFrontendIPConfiguration>]
[-BackendAddressPool <PSBackendAddressPool>]
[-Probe <PSProbe>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Set-AzureRmLoadBalancerRuleConfig
-LoadBalancer <PSLoadBalancer>
-Name <String>
[-Protocol <String>]
[-LoadDistribution <String>]
[-FrontendPort <Int32>]
[-BackendPort <Int32>]
[-IdleTimeoutInMinutes <Int32>]
[-EnableFloatingIP]
[-EnableTcpReset]
[-DisableOutboundSNAT]
[-FrontendIpConfigurationId <String>]
[-BackendAddressPoolId <String>]
[-ProbeId <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Set-AzureRmLoadBalancerRuleConfig cmdlet sets the goal state for a load balancer rule configuration.
Examples
Example 1: Modify a load balancing rule configuration
PS C:\>$slb = Get-AzureRmLoadBalancer -Name "MyLoadBalancer" -ResourceGroupName "MyResourceGroup"
PS C:\> $slb | Add-AzureRmLoadBalancerRuleConfig -Name "NewRule" -FrontendIPConfiguration $slb.FrontendIpConfigurations[0] -Protocol "Tcp" -FrontendPort 3350 -BackendPort 3350 -EnableFloatingIP
PS C:\> $slb | Set-AzureRmLoadBalancerRuleConfig -Name "NewRule" -FrontendIPConfiguration $slb.FrontendIpConfigurations[0] -Protocol "Tcp" -FrontendPort 3350 -BackendPort 3350
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-AzureRmLoadBalancerRuleConfig, which adds a rule named NewRule to it. The third command passes the load balancer to Set-AzureRmLoadBalancerRuleConfig, 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.
Type: | PSBackendAddressPool |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-BackendAddressPoolId
Specifies the ID of a BackendAddressPool object to associate with a load balancer rule configuration.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-BackendPort
Specifies the backend port for traffic that is matched by this rule configuration.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultProfile
The credentials, account, tenant, and subscription used for communication with azure.
Type: | IAzureContextContainer |
Aliases: | AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | 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.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-EnableFloatingIP
Indicates that this cmdlet enables a floating IP address for a rule configuration.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | 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.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-FrontendIpConfiguration
Specifies a list of front-end IP addresses to associate with a load balancer rule configuration.
Type: | PSFrontendIPConfiguration |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-FrontendIpConfigurationId
Specifies the ID for a front-end IP address configuration.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-FrontendPort
Specifies the front-end port that is matched by a load balancer rule configuration.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-IdleTimeoutInMinutes
Specifies the length of time, in minutes, for which the state of conversations is maintained in a load balancer.
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-LoadBalancer
Specifies a load balancer. This cmdlet sets the goal state rule configuration for the load balancer that this parameter specifies.
Type: | PSLoadBalancer |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-LoadDistribution
Specifies a load distribution. The acceptable values for this parameter are: SourceIP and SourceIPProtocol.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Name
Specifies the name of a load balancer.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Probe
Specifies a probe to associate with a load balancer rule configuration.
Type: | PSProbe |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-ProbeId
Specifies the ID of the probe to associate with a load balancer rule configuration.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Protocol
Specifies the protocol that is matched by a load balancer rule. The acceptable values for this parameter are: Tcp or Udp.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Parameters: LoadBalancer (ByValue)