Monitoring HTTP 5xx errors in an Azure App Service
The Azure App service UI used to have an ability to inspect 5xx errors directly. Since we starting using Azure, the UI has been changing almost constantly though, and this ability seems to have disappeared.
We are seeing some 5xx errors, and without bug reports, I'm wanting to get in to our application code and fix whatever crashes aren't being reported by users.
The log stream doesn't provide any useful information, so I'm left wondering here. What's a good way to get at the specifics of server-side errors that are occurring?
Solution 1:
To get the most detail on your errors you want to hook up your web app to App Insights. This will collect all this data and give you a (relatively) easy way to delve into them. App Insights has a free tier and you can enable it for basic monitoring without changing your app. See here.
Another area to look at is in Kudu. If you go to Advanced Tools (Kudu) in the portal, you can browse the content of your site and look in the logs folder. 500 Errors will usually show up in the event log.
Finally, if you click on the "Diagnose and solve problems" link and go to "availability and performance" the new diagnostic tool is actually pretty good at showing you errors and what causes them