4

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?

Scuba Steve
  • 149
  • 3
  • 9

3 Answers3

4

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

Sam Cogan
  • 38,158
  • 6
  • 77
  • 113
  • Ah yes, I had looked at the app insights, but held back on enabling it due to not wanting to force a server restart. I will take a look at doing this when we're off peak use on our app. Thanks! – Scuba Steve Jan 16 '19 at 21:30
  • I did look at the new diagnostics tool. It's neat, and it's showing me the URLs that are causing problems. But I really need the stack trace for whatever exception caused the 5xx error. – Scuba Steve Jan 16 '19 at 21:33
  • 1
    ok, if you want stack traces you want to either look at app insights, or in the Kudu event log – Sam Cogan Jan 16 '19 at 21:33
  • Yep. I'm really digging into the Kudu logs now. Thanks! – Scuba Steve Jan 16 '19 at 21:34
  • What is the name of the Azure service in which the "Diagnose and solve problems" data is stored? Can I query it without having to use the "Diagnose ..." U/I wizard? – ardave Apr 16 '19 at 21:49
  • 1
    @ardave all the dataa used by the diagnosis service comes from ther web app logs, which can be viewed using Kudu, or exported to storage accounts. – Sam Cogan Apr 19 '19 at 20:14
  • is this work on .net core ? – Ahmad Nov 24 '20 at 19:49
  • @Ahmad yes it will work – Sam Cogan Nov 24 '20 at 19:50
  • @SamCogan I am unable to find the log error file from kudu in my app service I am stuck what should I do ? – Ahmad Nov 25 '20 at 12:47
  • @Ahmad I would suggest you start a new question with more details on the issue and what you have done so far. – Sam Cogan Nov 25 '20 at 12:48
  • @SamCogan okay I was just people just mark as duplicate my question also limited on other one . they are changed also but people marked as duplicate/unclear etc so thats why – Ahmad Nov 25 '20 at 13:06
0

You can utilize an alert mechanism for create Azure App service.As soon as you encounter any Http5xx errors it can trigger certain alert to intimate you. Alert can be integrate with Action group also( which notifies you ) Notification option Email, SMS, LogicApp FunctionsApp Runbook ITSM Webhook

Hope it helps

Refernces: https://docs.microsoft.com/en-us/azure/azure-monitor/platform/alerts-metric-create-templates https://docs.microsoft.com/en-us/azure/azure-monitor/platform/alerts-metric-near-real-time https://docs.microsoft.com/en-us/azure/app-service/web-sites-monitor

Sachin Kalia
  • 101
  • 1
0

This is to clarify how to view a live 5xx error in Azure using Kudu:

  1. Go to Advanced Tools - > Kudo.

  2. Select "Log Streaming" and wait for it to load.

  3. Reproduce the 5xx error.

  4. You will see the error details appear live in the log.

Greg Gum
  • 127
  • 7