你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

New-AzApplicationGatewayRoutingRule

为应用程序网关创建路由规则。

语法

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

说明

Add-AzApplicationGatewayRoutingRule cmdlet 为 Azure 应用程序网关创建路由规则。

示例

示例 1:为应用程序网关创建路由规则

$Rule = New-AzApplicationGatewayRoutingRule -Name "Rule01" -RuleType Basic -Priority 100 -BackendSettings $Setting -Listener $Listener -BackendAddressPool $Pool

此命令创建名为 Rule01 的基本路由规则,并将结果存储在名为 $Rule 的变量中。

参数

-BackendAddressPool

应用程序网关 BackendAddressPool

类型:PSApplicationGatewayBackendAddressPool
Position:Named
默认值:None
必需:False
Accept pipeline input:False
Accept wildcard characters:False

-BackendAddressPoolId

应用程序网关 BackendAddressPool 的 ID

类型:String
Position:Named
默认值:None
必需:False
Accept pipeline input:False
Accept wildcard characters:False

-BackendSettings

应用程序网关后端设置

类型:PSApplicationGatewayBackendSettings
Position:Named
默认值:None
必需:False
Accept pipeline input:False
Accept wildcard characters:False

-BackendSettingsId

应用程序网关后端的 ID设置

类型:String
Position:Named
默认值:None
必需:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

用于与 Azure 通信的凭据、帐户、租户和订阅。

类型:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
默认值:None
必需:False
Accept pipeline input:False
Accept wildcard characters:False

-Listener

应用程序网关侦听器

类型:PSApplicationGatewayListener
Position:Named
默认值:None
必需:False
Accept pipeline input:False
Accept wildcard characters:False

-ListenerId

应用程序网关侦听器的 ID

类型:String
Position:Named
默认值:None
必需:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

路由规则的名称

类型:String
Position:Named
默认值:None
必需:True
Accept pipeline input:False
Accept wildcard characters:False

-Priority

规则的优先级

类型:Nullable<T>[Int32]
Position:Named
默认值:None
必需:True
Accept pipeline input:False
Accept wildcard characters:False

-RuleType

规则的类型

类型:String
接受的值:Basic, PathBasedRouting
Position:Named
默认值:None
必需:True
Accept pipeline input:False
Accept wildcard characters:False

输入

None

输出

PSApplicationGatewayRoutingRule