共用方式為


Add-AzApplicationGatewayRoutingRule

將路由規則新增至應用程式閘道。

語法

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

Add-AzApplicationGatewayRoutingRule Cmdlet 會將路由規則新增至應用程式閘道。

範例

範例 1:將路由規則新增至應用程式閘道

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

第一個命令會取得應用程式閘道,並將其儲存在$AppGw變數中。 第二個命令會將路由規則新增至應用程式閘道。

參數

-ApplicationGateway

applicationGateway

類型:PSApplicationGateway
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-BackendAddressPool

應用程式閘道 BackendAddressPool

類型:PSApplicationGatewayBackendAddressPool
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-BackendAddressPoolId

應用程式網關 BackendAddressPool 的標識碼

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-BackendSettings

應用程式閘道後端 設定

類型:PSApplicationGatewayBackendSettings
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-BackendSettingsId

應用程式閘道後端的標識碼 設定

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DefaultProfile

用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。

類型:IAzureContextContainer
別名:AzContext, AzureRmContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Listener

應用程式閘道接聽程式

類型:PSApplicationGatewayListener
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ListenerId

應用程式閘道接聽程式的標識碼

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Name

路由規則的名稱

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-Priority

規則的優先順序

類型:Nullable<T>[Int32]
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-RuleType

規則的類型

類型:String
接受的值:Basic, PathBasedRouting
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

輸入

PSApplicationGateway

輸出

PSApplicationGateway