New-AzLoadBalancerRuleConfig
Creates a rule configuration for a load balancer.
Syntax
New-AzLoadBalancerRuleConfig
-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>]
New-AzLoadBalancerRuleConfig
-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 New-AzLoadBalancerRuleConfig cmdlet creates a rule configuration for an Azure load balancer.
Examples
Example 1: Creating a rule configuration for an Azure Load Balancer
PS C:\> $publicip = New-AzPublicIpAddress -ResourceGroupName "MyResourceGroup" `
-name MyPublicIP -location 'West US' -AllocationMethod Dynamic
PS C:\> $frontend = New-AzLoadBalancerFrontendIpConfig -Name MyFrontEnd `
-PublicIpAddress $publicip
PS C:\> $probe = New-AzLoadBalancerProbeConfig -Name MyProbe -Protocol http -Port `
80 -IntervalInSeconds 15 -ProbeCount 2 -RequestPath healthcheck.aspx
PS C:\> New-AzLoadBalancerRuleConfig -Name "MyLBrule" -FrontendIPConfiguration `
$frontend -BackendAddressPool $backendAddressPool -Probe $probe -Protocol Tcp `
-FrontendPort 80 -BackendPort 80 -IdleTimeoutInMinutes 15 -EnableFloatingIP `
-LoadDistribution SourceIP
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
Specifies a BackendAddressPool object to associate with a load balancer rule configuration.
Type: | PSBackendAddressPool |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the ID of a BackendAddressPool object to associate with a load balancer rule configuration.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the backend port for traffic that is matched by this load balancer rule configuration.
Type: | Int32 |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with azure.
Type: | Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
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 |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Indicates that this cmdlet enables a floating IP address for a rule configuration.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
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 |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies a list of front-end IP addresses to associate with a load balancer rule configuration.
Type: | PSFrontendIPConfiguration |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the ID for a front-end IP address configuration.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the front-end port that is matched by a load balancer rule configuration.
Type: | Int32 |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the length of time, in minutes, that the state of conversations is maintained in a load balancer.
Type: | Int32 |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies a load distribution. The acceptable values for this parameter are:
- Default
- SourceIP
- SourceIPProtocol
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the name of the load balancing rule that this cmdlet creates.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Specifies a probe to associate with a load balancer rule configuration.
Type: | PSProbe |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the ID of the probe to associate with a load balancer rule configuration.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Specifies the protocol that is matched by a load balancer rule configuration. The acceptable values for this parameter are: Tcp or Udp.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |