Application gateway error 502

0 votes

I have set up a new Application Gateway by following the documentation. I have configured the backend pool and connected it to an App Service via FQDN. But, somehow I receive error 502 every time I browse to the gateway. Browsing to the website directly works without issues .

Apr 4, 2019 in Azure by sabby
• 4,370 points
549 views

1 answer to this question.

0 votes

You need to set up the health probes via ARM templates or using PowerShelI as they cannot be setup through Azure Portal if you have web apps in your backend pools. You need to leave the host field empty and set -PickHostNameFromBackendAddress property.

This code snippet should resolve your error:

# Create a probe with the PickHostNameFromBackendHttpSettings switch for web apps
$probeconfig = New-AzureRmApplicationGatewayProbeConfig -name webappprobe -Protocol Http -Path / -Interval 30 -Timeout 120 -UnhealthyThreshold 3 -PickHostNameFromBackendHttpSettings    

# Define the backend http settings
$poolSetting = New-AzureRmApplicationGatewayBackendHttpSettings -Name appGatewayBackendHttpSettings -Port 80 -Protocol Http -CookieBasedAffinity Disabled -RequestTimeout 120 -PickHostNameFromBackendAddress -Probe $probeconfig
answered Apr 4, 2019 by p
• 1,960 points

Related Questions In Azure

0 votes
1 answer

I am getting a network related error saying "cannot connect to a server". need help here.

Actually i got the same error, it ...READ MORE

answered Apr 26, 2018 in Azure by null_void
• 3,220 points
213 views
0 votes
2 answers

In Azure powershell Select-AzureSubscription command fetching error: the subscription name doesn't exist

The problem you're having is that the ...READ MORE

answered Aug 16, 2018 in Azure by Priyaj
• 57,700 points
4,104 views
0 votes
1 answer

Is there a way to get ERROR details on Azure website?

You have two options: First, you can turn ...READ MORE

answered May 25, 2018 in Azure by club_seesharp
• 3,450 points
1,111 views
0 votes
1 answer

How to add an App Settings to existing Azure Web Application using Azure Power Shell?

The example is for slot-specific settings, if ...READ MORE

answered Jun 13, 2018 in Azure by club_seesharp
• 3,450 points
477 views
0 votes
1 answer

How to install Windows Azure Storage Emulator?

There may be an issue with the ...READ MORE

answered Mar 6, 2019 in Azure by p
• 1,960 points
957 views
0 votes
1 answer

Friendly filename when downloading Azure blob.

Azure blobs can be downloaded in four ...READ MORE

answered Mar 15, 2019 in Azure by p
• 1,960 points
577 views
0 votes
1 answer

How to debug Azure 500 internal server error?

You can simply turn off custom error in ...READ MORE

answered Mar 29, 2019 in Azure by p
• 1,960 points
2,432 views
0 votes
1 answer

Trying to understand Load Balancing in Azure.

For your clarification - Azure DOES support load balancing in ...READ MORE

answered Mar 29, 2019 in Azure by p
• 1,960 points
58 views
0 votes
1 answer

Error in CGI application - process terminated.

To fix this error, you need to deploy to ...READ MORE

answered Apr 9, 2019 in Azure by p
• 1,960 points
700 views
0 votes
1 answer

Azure Storage Emulator shows error.

This blog might help with your query: http://blog.smarx.com/posts/windows-azure-storage-emulator-the-process-cannot-access-the-file-because-it-is-being-used-by-another-process Also, ...READ MORE

answered Mar 15, 2019 in Azure by p
• 1,960 points
481 views