Add-AzApplicationGatewayUrlPathMapConfig
將 URL 路徑對應的陣列新增至後端伺服器集區。
Syntax
Add-AzApplicationGatewayUrlPathMapConfig
-ApplicationGateway <PSApplicationGateway>
-Name <String>
-PathRules <PSApplicationGatewayPathRule[]>
-DefaultBackendAddressPool <PSApplicationGatewayBackendAddressPool>
-DefaultBackendHttpSettings <PSApplicationGatewayBackendHttpSettings>
[-DefaultRewriteRuleSet <PSApplicationGatewayRewriteRuleSet>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Add-AzApplicationGatewayUrlPathMapConfig
-ApplicationGateway <PSApplicationGateway>
-Name <String>
-PathRules <PSApplicationGatewayPathRule[]>
-DefaultBackendAddressPoolId <String>
-DefaultBackendHttpSettingsId <String>
[-DefaultRewriteRuleSetId <String>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Add-AzApplicationGatewayUrlPathMapConfig
-ApplicationGateway <PSApplicationGateway>
-Name <String>
-PathRules <PSApplicationGatewayPathRule[]>
[-DefaultRewriteRuleSet <PSApplicationGatewayRewriteRuleSet>]
-DefaultRedirectConfiguration <PSApplicationGatewayRedirectConfiguration>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Add-AzApplicationGatewayUrlPathMapConfig
-ApplicationGateway <PSApplicationGateway>
-Name <String>
-PathRules <PSApplicationGatewayPathRule[]>
[-DefaultRewriteRuleSetId <String>]
-DefaultRedirectConfigurationId <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Add-AzApplicationGatewayUrlPathMapConfig Cmdlet 會將 URL 路徑對應數位新增至後端伺服器集區。
範例
範例 1:將 URL 路徑對應新增至應用程式閘道。
$appgw = Get-AzApplicationGateway -ResourceGroupName "rg" -Name "appGwName"
$pool = Get-AzApplicationGatewayBackendAddressPool -ApplicationGateway $appgw -Name "pool01"
$poolSettings = Get-AzApplicationGatewayBackendHttpSetting -ApplicationGateway $appgw -Name "poolSettings01"
$pathRule = New-AzApplicationGatewayPathRuleConfig -Name "rule01" -Paths "/path" -BackendAddressPool $pool -BackendHttpSettings $poolSettings
$appgw = Add-AzApplicationGatewayUrlPathMapConfig -ApplicationGateway $appgw -Name "url01" -PathRules $pathRule -DefaultBackendAddressPool $pool -DefaultBackendHttpSettings $poolSettings
$appgw = Set-AzApplicationGateway -ApplicationGateway $appgw
第一個命令會取得名為 appGwName 的應用程式閘道,並將其儲存在$appgw 變數中。 第二個命令會取得後端位址池,並將其儲存在 $pool 變數中。 第三個命令會取得後端 HTTP 設定,並將其儲存在 $pool設定 變數中。 第四個命令會建立名為 rule01 的新路徑規則組態,並將其儲存在 $pathRule 變數中。 第五個命令會將名為url01的URL路徑對應組態新增至應用程式閘道。 第六個命令會更新應用程式閘道。
參數
-ApplicationGateway
指定此 Cmdlet 新增 URL 路徑對應組態的應用程式閘道。
Type: | PSApplicationGateway |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-DefaultBackendAddressPool
指定要路由傳送的預設後端位址池,以防 pathRules 參數中未指定任何規則相符。
Type: | PSApplicationGatewayBackendAddressPool |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultBackendAddressPoolId
指定預設後端位址池識別碼。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultBackendHttpSettings
指定預設後端 HTTP 設定,以防 pathRules 參數中未指定任何規則相符時使用。
Type: | PSApplicationGatewayBackendHttpSettings |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultBackendHttpSettingsId
指定預設後端 HTTP 設定識別碼。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultProfile
用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶。
Type: | IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultRedirectConfiguration
應用程式閘道預設 RedirectConfiguration
Type: | PSApplicationGatewayRedirectConfiguration |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultRedirectConfigurationId
應用程式閘道預設 RedirectConfiguration 的識別碼
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultRewriteRuleSet
應用程式閘道預設重寫規則集
Type: | PSApplicationGatewayRewriteRuleSet |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DefaultRewriteRuleSetId
應用程式閘道預設重寫規則集的標識碼
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Name
指定此 Cmdlet 新增至後端伺服器集區的 URL 路徑對應名稱。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PathRules
指定路徑規則的清單。 路徑規則會區分順序,它們會依指定的順序套用。
Type: | PSApplicationGatewayPathRule[] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
輸入
輸出
相關連結
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應