Application Gateway - 502 error

前端 未结 1 1120
情话喂你
情话喂你 2021-01-03 08:49

I have set up a new application Gateway following the MS document. I have configured the back end pool .it is connected to an App Service via FQDN. Somehow I receive 502 i

1条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-03 09:31

    I have resolved this issue. Here is the solution.

    If you have web apps in your backend pools you CAN'T set up the health probes via Azure portal.

    You need to set them up via resource templates or Powershell. The key is that you need to leave the host field empty and set -PickHostNameFromBackendAddress property.

    The two lines below did the magic to make the 502s go away

    # 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
    

    0 讨论(0)
提交回复
热议问题