Share via


Add-AzApplicationGatewayCustomError

Egyéni hibát ad hozzá egy Application Gatewayhez.

Syntax

Add-AzApplicationGatewayCustomError
   -ApplicationGateway <PSApplicationGateway>
   -StatusCode <String>
   -CustomErrorPageUrl <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

Az Add-AzApplicationGatewayCustomError parancsmag egyéni hibát ad hozzá egy application gatewayhez.

Példák

1. példa: Egyéni hiba hozzáadása az Application Gateway szintjéhez

$resourceGroupName = "resourceGroupName"
$AppGWName = "applicationGatewayName"
$AppGw = Get-AzApplicationGateway -Name $AppGWName -ResourceGroupName $resourceGroupName
$customError502Url = "https://mycustomerrorpages.blob.core.windows.net/errorpages/502.htm"
$updatedgateway = Add-AzApplicationGatewayCustomError -ApplicationGateway $AppGw -StatusCode HttpStatus502 -CustomErrorPageUrl $customError502Url
Set-AzApplicationGateway -ApplicationGateway $AppGw

Ez a parancs az 502-ben megadott http-állapotkód egyéni hibáját adja hozzá az Application Gateway $appgw, és visszaadja a frissített átjárót.

2. példa: Egyéni hiba hozzáadása az Application Gateway figyelőjének szintjéhez

$resourceGroupName = "resourceGroupName"
 $AppGWName = "applicationGatewayName"
 $customError502Url = "https://mycustomerrorpages.blob.core.windows.net/errorpages/502.htm"
 $listenerName = "listenerName"
 $AppGw = Get-AzApplicationGateway -Name $AppGWName -ResourceGroupName $resourceGroupName
 $listener = Get-AzApplicationGatewayHttpListener -ApplicationGateway $AppGW -Name $listenerName
 $updatedListener = Add-AzApplicationGatewayHttpListenerCustomError -HttpListener $listener -StatusCode HttpStatus502 -CustomErrorPageUrl $customError502Url 
 Set-AzApplicationGateway -ApplicationGateway $AppGw

Ez a parancs az 502-es http-állapotkód egyéni hibáját adja hozzá az Application Gateway $appgw a figyelő szintjén, és visszaadja a frissített átjárót.

Paraméterek

-ApplicationGateway

Az Application Gateway

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

-CustomErrorPageUrl

Az Application Gateway ügyfélhibájának hibaoldali URL-címe.

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

-DefaultProfile

Az Azure-ral való kommunikációhoz használt hitelesítő adatok, fiók, bérlő és előfizetés.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-StatusCode

Az Application Gateway-ügyfél hibájának állapotkódja.

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

Bevitelek

PSApplicationGateway

Kimenetek

PSApplicationGatewayCustomError