@Barrymx Thank you for reaching out to Microsoft Q&A. Apologize for the inconvenience caused on this.
As @Takahito Iwasa suggested you can Enable diagnostic logging for your webapp and troubleshoot or you can run the Availability and Performance (under Diagnose and solve problems).
In general, 502 errors often caused by application-level issues, such as requests taking a long time; application using high memory/CPU; application crashing due to an exception. You can follow this article Troubleshoot HTTP errors of "502 bad gateway" and "503 service unavailable" in Azure App Service to identify the issue as well.
Feel free to reach back to me if you have any further questions on this.