I've noticed the 502 error after deployment to Azure question, but it appears to be related to a failed deployment and rollback of databases - not what we're seeing here.
I am getting the above
502 - Web server received an invalid response while acting as a gateway or proxy server
It happens after any completion of our Azure DevOps pipeline that deploys to the WebApp. Here's what I've observed:
- It happens on serving any of the "public" sites on the solution. So if I call up a page from an SXA site or a regular site, I get about a 5 minute delay while it's loading and then ultimately giving up.
- It does not happen when I reach the "internal" sites on the solution. Content Editor for instance. It does happen if I try and start the Experience Editor.
- Strangely, "Smiling Asian Lady" (default Website) loads up almost instantly. The problem may be isolated to SXA
After the 5-10 minute wait and the initial 502 error being shown, I can refresh the page and Sitecore proceeds to serve up the requested page as if it went through a normal cold-start. So roughly 30 seconds.
I'm pretty sure this has something to do with the Azure Gateway.edited to clarify/rectify
We don't have an explicit AppGateway in front of our sites. We do however use Auto Scaling (not dynamic, but set to 2 instances) which would mean that the scaling has an internal load balancer set upin place. Which I guess acts in much the same way as a gateway would do.
Can anyone point me to what's going on here?