編輯

共用方式為


Add-AzApplicationGatewayRoutingRule

Adds a routing rule to an application gateway.

Syntax

Add-AzApplicationGatewayRoutingRule
   -ApplicationGateway <PSApplicationGateway>
   -Name <String>
   -RuleType <String>
   -Priority <Int32>
   [-BackendSettings <PSApplicationGatewayBackendSettings>]
   [-Listener <PSApplicationGatewayListener>]
   [-BackendAddressPool <PSApplicationGatewayBackendAddressPool>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]
Add-AzApplicationGatewayRoutingRule
   -ApplicationGateway <PSApplicationGateway>
   -Name <String>
   -RuleType <String>
   -Priority <Int32>
   [-BackendSettingsId <String>]
   [-ListenerId <String>]
   [-BackendAddressPoolId <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Add-AzApplicationGatewayRoutingRule cmdlet adds a routing rule to an application gateway.

Examples

Example 1: Add a routing rule to an application gateway

$AppGw = Get-AzApplicationGateway -Name "ApplicationGateway01" -ResourceGroupName "ResourceGroup01"
$Appgw = Add-AzApplicationGatewayRoutingRule -ApplicationGateway $AppGw -Name "Rule01" -RuleType Basic -Priority 100 -BackendSettings $Setting -Listener $Listener -BackendAddressPool $Pool

The first command gets the application gateway and stores it in the $AppGw variable. The second command adds the routing rule to the application gateway.

Parameters

-ApplicationGateway

The applicationGateway

Type:PSApplicationGateway
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-BackendAddressPool

Application gateway BackendAddressPool

Type:PSApplicationGatewayBackendAddressPool
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-BackendAddressPoolId

ID of the application gateway BackendAddressPool

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-BackendSettings

Application gateway BackendSettings

Type:PSApplicationGatewayBackendSettings
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-BackendSettingsId

ID of the application gateway BackendSettings

Type:String
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:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Listener

Application gateway Listener

Type:PSApplicationGatewayListener
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ListenerId

ID of the application gateway Listener

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

The name of the Routing Rule

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Priority

The priority of the rule

Type:Nullable<T>[Int32]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-RuleType

The type of rule

Type:String
Accepted values:Basic, PathBasedRouting
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

Inputs

PSApplicationGateway

Outputs

PSApplicationGateway