Set-AzApplicationGatewayRedirectConfiguration
在現有的應用程式閘道上設定重新導向組態。
語法
Set-AzApplicationGatewayRedirectConfiguration
-ApplicationGateway <PSApplicationGateway>
-Name <String>
-RedirectType <String>
[-TargetListenerID <String>]
[-IncludePath <Boolean>]
[-IncludeQueryString <Boolean>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Set-AzApplicationGatewayRedirectConfiguration
-ApplicationGateway <PSApplicationGateway>
-Name <String>
-RedirectType <String>
[-TargetListener <PSApplicationGatewayHttpListener>]
[-IncludePath <Boolean>]
[-IncludeQueryString <Boolean>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Set-AzApplicationGatewayRedirectConfiguration
-ApplicationGateway <PSApplicationGateway>
-Name <String>
-RedirectType <String>
[-TargetUrl <String>]
[-IncludePath <Boolean>]
[-IncludeQueryString <Boolean>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
Set-AzApplicationGatewayRequestRoutingRule Cmdlet 會修改重新導向設定。
範例
範例 1
$AppGw = Get-AzApplicationGateway -Name "ApplicationGateway01" -ResourceGroupName "ResourceGroup01"
$AppGw = Set-AzApplicationGatewayRedirectConfiguration -ApplicationGateway $appgw -Name "RedirectConfig01" -RedirectType Permanent -TargetUrl "https://www.contoso.com"
第一個命令會取得名為ApplicationGateway01的應用程式閘道,並將它儲存在 $AppGw變數中。 第二個命令會修改應用程式閘道的重新導向組態,以重新導向類型永久並使用目標URL。
範例 2
在現有的應用程式閘道上設定重新導向組態。 ( 自動產生 )
Set-AzApplicationGatewayRedirectConfiguration -ApplicationGateway <PSApplicationGateway> -IncludePath $false -IncludeQueryString $false -Name 'RedirectConfig01' -RedirectType Permanent -TargetListener <PSApplicationGatewayHttpListener>
參數
-ApplicationGateway
applicationGateway
類型: | PSApplicationGateway |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-DefaultProfile
用於與 azure 通訊的認證、帳戶、租用戶和訂用帳戶。
類型: | IAzureContextContainer |
別名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-IncludePath
在重新導向的 URL 中包含路徑。 默認值為 true。
類型: | Nullable<T>[Boolean] |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-IncludeQueryString
在重新導向的 URL 中包含查詢字串。 默認值為 true。
類型: | Nullable<T>[Boolean] |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Name
重新導向組態的名稱
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-RedirectType
重新導向的類型
類型: | String |
接受的值: | Permanent, Found, SeeOther, Temporary |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-TargetListener
HTTP 接聽程式將要求重新導向至
類型: | PSApplicationGatewayHttpListener |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-TargetListenerID
HTTP 接聽程式的標識碼,以將要求重新導向至
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-TargetUrl
目標 URL 重新導向
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |