Error 502 while using Application Gateway with App Service Environment

Copper Contributor



I have setup Application Service environment and trying to access WebApps inside App service environment through Application gateway.  Below are the steps I followed to create required setup however I am getting "502 - Web server received an invalid response while acting as a gateway or proxy server" error when I hit the URL that is mapped with application gateway public URL


1) Created Vnet and created App Service environment inside separate subnet, used subdomain name as I used ILB wild card certificate here issued to *

2) Created app inside App service environment and named it as "" and added externally accessible DNS name in the custom domain as "" 

3) Created Application gateway, added Internal IP address of ILB ( App Service Environment) as back end pool

4) Created App Gateway-HTTP Settings using port 80 and mapped it with custom probe

4)  Created App Gateway-CustomProbe, host name used here is extenally accessible DNS name which is "" 

5) Created App Gateway-Listner  using host name as extenally accessible DNS name which is "" 

6) Added a basic rule and mapped above resources with each other


I am still not able to access my Web App after acessing


I am not sure about how port number used to create listner affect the setup or if  I am missing anything.


I also want to implement SSL once I am done with above testing, I would appretiate inputs on how to implement that for above setup.

0 Replies