From e09a374c424c4721e5e178d5fd16798ba86e29a3 Mon Sep 17 00:00:00 2001 From: hagop-globanet <42701461+hagop-globanet@users.noreply.github.com> Date: Thu, 27 Aug 2020 11:48:54 +0400 Subject: [PATCH] Update Add-AzApplicationGatewayCustomError.md Example 1 was missing Get-AzApplicationGateway, Set-AzApplicationGateway In Example 2 Variable $resourceGroup was not used. instead a variable named $rg was used which was not set. --- .../Add-AzApplicationGatewayCustomError.md | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/Network/Network/help/Add-AzApplicationGatewayCustomError.md b/src/Network/Network/help/Add-AzApplicationGatewayCustomError.md index d5712313f3ee..b01e767a143f 100644 --- a/src/Network/Network/help/Add-AzApplicationGatewayCustomError.md +++ b/src/Network/Network/help/Add-AzApplicationGatewayCustomError.md @@ -24,22 +24,26 @@ The **Add-AzApplicationGatewayCustomError** cmdlet adds a custom error to an app ### Example 1: Adds custom error to application gateway level ```powershell +PS C:\> $resourceGroupName = "resourceGroupName" +PS C:\> $AppGWName = "applicationGatewayName" +PS C:\> $AppGw = Get-AzApplicationGateway -Name $AppGWName -ResourceGroup $resourceGroupName PS C:\> $customError502Url = "https://mycustomerrorpages.blob.core.windows.net/errorpages/502.htm" -PS C:\> $updatedgateway = Add-AzApplicationGatewayCustomError -ApplicationGateway $appgw -StatusCode HttpStatus502 -CustomErrorPageUrl $customError502Url +PS C:\> $updatedgateway = Add-AzApplicationGatewayCustomError -ApplicationGateway $AppGw -StatusCode HttpStatus502 -CustomErrorPageUrl $customError502Url +PS C:\> Set-AzApplicationGateway -ApplicationGateway $AppGw ``` This command adds a custom error of http status code 502 to the application gateway $appgw, and return the updated gateway. ### Example 2: Adds custom error to application gateway listener level ```powershell -PS C:\> $resourceGroup = "resourceGroupName" -PS C:\> $AppGWName = "applicationGatewayName" -PS C:\> $customError502Url = "https://mycustomerrorpages.blob.core.windows.net/errorpages/502.htm" -PS C:\> $listenerName = "listenerName" -PS C:\> $AppGw = Get-AzApplicationGateway -Name $AppGWName -ResourceGroupName $rg -PS C:\> $listener = Get-AzApplicationGatewayHttpListener -ApplicationGateway $AppGW -Name $listenerName -PS C:\> $updatedListener = Add-AzApplicationGatewayHttpListenerCustomError -HttpListener $listener -StatusCode HttpStatus502 -CustomErrorPageUrl $customError502Url -PS C:\> Set-AzApplicationGateway -ApplicationGateway $AppGw + $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 ``` This command adds a custom error of http status code 502 to the application gateway $appgw at the listener level, and return the updated gateway.