502 is pretty generic but check out what the resources (web app, database, cache service, etc) are running and up those services so you're less than 50% usage (CPU, memory, DTU, etc). Check the event log by running the following query:
SELECT TOP 100 *
FROM CMS_EventLog
ORDER BY EventTime DESC
And review the errors in the event log.
Turn on Application Insights on the website (done in the web app).
Turn on logging on the website (done in the web app).