Add-AzApplicationGatewayCustomError
Voegt een aangepaste fout toe aan een toepassingsgateway.
Syntaxis
Add-AzApplicationGatewayCustomError
-ApplicationGateway <PSApplicationGateway>
-StatusCode <String>
-CustomErrorPageUrl <String>
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
De cmdlet Add-AzApplicationGatewayCustomError voegt een aangepaste fout toe aan een toepassingsgateway.
Voorbeelden
Voorbeeld 1: Voegt aangepaste fout toe aan toepassingsgatewayniveau
$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
Met deze opdracht wordt een aangepaste fout van http-statuscode 502 toegevoegd aan de toepassingsgateway $appgw en wordt de bijgewerkte gateway geretourneerd.
Voorbeeld 2: Voegt aangepaste fout toe aan het listenerniveau van de toepassingsgateway
$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
Met deze opdracht wordt een aangepaste fout van http-statuscode 502 toegevoegd aan de toepassingsgateway $appgw op listenerniveau en wordt de bijgewerkte gateway geretourneerd.
Parameters
-ApplicationGateway
De toepassingsgateway
Type: | PSApplicationGateway |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | True |
Jokertekens accepteren: | False |
-CustomErrorPageUrl
Foutpagina-URL van de fout van de klant van de toepassingsgateway.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-DefaultProfile
De referenties, accounts, tenants en abonnementen die worden gebruikt voor communicatie met Azure.
Type: | IAzureContextContainer |
Aliassen: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Vereist: | False |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
-StatusCode
Statuscode van de application gateway-klantfout.
Type: | String |
Position: | Named |
Default value: | None |
Vereist: | True |
Pijplijninvoer accepteren: | False |
Jokertekens accepteren: | False |
Invoerwaarden
Uitvoerwaarden
PSApplicationGatewayCustomError
Verwante koppelingen
Azure PowerShell