2

I am new to Azure web jobs, I am creating a console application of .net framework for the webjob(triggered). I have noticed that the sometimes web job is failing because "SCM_COMMAND_IDLE_TIMEOUT". So Is there a way to get alert when these type of exceptions occurs, So I could go and restart the web job.

Any help would be appreciated.

Thanks.

Tony Ju
  • 14,891
  • 3
  • 17
  • 31
Krishna089
  • 101
  • 20

1 Answers1

1

First please note that we can set SCM_COMMAND_IDLE_TIMEOUT value in application settings. The detailed steps are here.

Also, you can use Application Insights to catch the exception and get notification. You can enable it in your webapp.

enter image description here

reference:

Set Alerts in Application Insights.

Update:

I didn't have a webjob running, so I use System.IO.FileNotFoundException as a sample.

enter image description here

You can find all the logs here, you can test your query to filter the exception you want to trigger the alert.

enter image description here

Tony Ju
  • 14,891
  • 3
  • 17
  • 31
  • Hi @Tony, Thanks for the Help. so by setting an alert in Application Insights, Can we get alert for web job failure for any reason it might be(not only for SCM_COMMAND_IDLE_TIMEOUT)? Thanks. – Krishna089 Apr 20 '20 at 09:38
  • @Chekrii Yes, you can custom the log search as a signal logic for triggering an alert. – Tony Ju Apr 20 '20 at 09:40
  • @Chekrii There are also many general signals you can use directly, such as Failed requests. – Tony Ju Apr 20 '20 at 09:43
  • OK @Tony, Thanks. right now I am looking at how to set an alert in Application insights for web jobs. – Krishna089 Apr 20 '20 at 09:45
  • 1
    @Chekrii There is no specific document for seting alert for webjob, webjob is a feature under webapp. You need to custom the query to filter out the webjob exception. I will show you some screenshot in the answer. – Tony Ju Apr 20 '20 at 10:06
  • ,Can you please provide an example for web job, that should be in the search query. I am unable to write a query that points to my web job. – Krishna089 Apr 23 '20 at 16:11
  • 1
    @Chekrii You should post a new question, then your question will be visible to others. – Tony Ju Apr 24 '20 at 01:29