Long wait times in first part of call to WordPress on Azure

Whilst I appreciate it’s not the solution anyone would want after they’ve chosen to host on an Azure Web App, I’m yet to find anyone with a solution to this problem and I’ve spent a long time looking. I also debugged every one of our plugins and our theme with a fine tooth comb and still could not find the cause. All I could be sure about was a vanilla install works fine, but somewhere in the course of development, plugins, themes, etc, something causes this.

In the end my solution was to move all of our WordPress sites into a dedicated Azure Virtual Machine and use IIS Host Headers to create a multi-tenant environment.