Azure Apps: Getting 503 errors for slot, creating a new slot and swap, not working!

Hi!
I take advantage of a recent experience i had working with some customers implementing Websites under Azure Web Apps. This particular customerwas getting some 503 errors on the Slot, although they created a new Slot and swap, the issue remained.

Analysis
----------------------------------------

We advanced with IIS / FREBs logs analysis and managed to verify some preload request stucked in a customer’s method and it was stucked on that situation, for several hours.
Heavy Scenarios under this configuration might generate a hang dump of the app to debug it Offline.
Checking the slot where https://YourSite-stage.azurewebsites.net/ run and got 503, the requests were getting to the worker, but there were some timing out in the queue. This was happening as the preload request was stuck in the code ( this symptom could also occur if customers’ requests were piling up in the App as well so when timing out on the worker, probably because of the Application code causing the issue). Preload requests finished intermittently for the code deployed to the slot :Process got stuck in preload so it never started processing requests from the HTTP queue.

Solution!
----------------------------------------

We recommended to the Customer to Disable the preload on the slot, so that would avoid the block opening the queue until the preload request finishes, they will start piling up the requests in the application instead of the queue.
By this, Developers would have an easier work for verifying where the bottleneck is, probably profiler events being emitted, would help on verifying what the code is doing.

HOW TO: Turn Off preload?
-------------------------- Well, there are a couple ways to accomplish that:
1. Disable Always On in the App settings for the slot (will need an organic request to startup the App)
2. Use a transform to turn it off for the site. You need to place the to lowing Applicationhost.xdt in the D:\Home\Site folder.

Test

Hope it helps!!!! :)

Remarks:
--------------
Logging Enable IIS logs in Azure Web Apps Enable FREB logs in Azure Web Apps