Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
New-AzLoadBalancerRuleConfig
- Module:
- Az.Network Module
Creates a rule configuration for a load balancer.
Syntax
SetByResource (Default)
New-AzLoadBalancerRuleConfig
-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
New-AzLoadBalancerRuleConfig
-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 New-AzLoadBalancerRuleConfig cmdlet creates a rule configuration for an Azure load balancer.
Examples
Example 1: Creating a rule configuration for an Azure Load Balancer
$publicip = New-AzPublicIpAddress -ResourceGroupName "MyResourceGroup" `
-name MyPublicIP -location 'West US' -AllocationMethod Dynamic
$frontend = New-AzLoadBalancerFrontendIpConfig -Name MyFrontEnd `
-PublicIpAddress $publicip
$probe = New-AzLoadBalancerProbeConfig -Name MyProbe -Protocol http -Port `
80 -IntervalInSeconds 15 -ProbeCount 2 -ProbeThreshold 2 -RequestPath healthcheck.aspx
New-AzLoadBalancerRuleConfig -Name "MyLBrule" -FrontendIPConfiguration `
$frontend -BackendAddressPool $backendAddressPool -Probe $probe -Protocol Tcp `
-FrontendPort 80 -BackendPort 80 -IdleTimeoutInMinutes 15 -EnableFloatingIP `
-LoadDistribution SourceIP
Example 2: Creating a rule configuration for an Azure Load Balancer with Gateway Load Balancer
$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 | Add-AzLoadBalancerRuleConfig -Name "NewRule" -FrontendIPConfiguration $slb.FrontendIpConfigurations[0] -Protocol "All" -FrontendPort 0 -BackendPort 0 -BackendAddressPool $MyBackendPool1,$MyBackendPool2
$slb | Set-AzLoadBalancer
The first three commands set up a public IP, a front end, and a probe for the rule configuration in the forth command. The forth command creates a new rule called MyLBrule with certain specifications.
Parameters
-BackendAddressPool
Specifies a BackendAddressPool object to associate with a load balancer rule configuration.
Parameter properties
| Type: | |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-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
-BackendPort
Specifies the backend port for traffic that is matched by this load balancer rule configuration.
Parameter properties
| Type: | Int32 |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-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
-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
-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
-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
-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
-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
-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
-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
-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
-IdleTimeoutInMinutes
Specifies the length of time, in minutes, that the state of conversations is maintained in a load balancer.
Parameter properties
| Type: | Int32 |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-LoadDistribution
Specifies a load distribution. The acceptable values for this parameter are:
- Default
- SourceIP
- SourceIPProtocol
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-Name
Specifies the name of the load balancing rule that this cmdlet creates.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-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
-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
-Protocol
Specifies the protocol that is matched by a load balancer rule configuration. The acceptable values for this parameter are: Tcp or Udp.
Parameter properties
| Type: | String |
| Default value: | None |
| Supports wildcards: | False |
| DontShow: | False |
Parameter sets
-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
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
String
Int32
PSFrontendIPConfiguration
PSBackendAddressPool
PSProbe
Outputs
PSLoadBalancingRule
Related Links
Azure PowerShell
Feedback
Was this page helpful?
