Thanks for asking question! There could be many reasons for 502 errors.
To add to above this problem is 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 may follow this article Troubleshoot HTTP errors of "502 bad gateway" and "503 service unavailable" in Azure App Service to identify the issue, Also, make sure there is no network connection broken on your side.
If the web app still does not work, you can try to re-deploy it.
Hope this helps.