Krishna089
Krishna089

Reputation: 101

How to set Alert in Application Insights for the web jobs and to get notification when Webjob fails

Can anyone help me with how to set an alert for azure web job in application insights? Whenever the web job is "Failed" status, I should get an Email, So that I can go and restart it.

Or Is there any better way to get alerts than Application insights?

Any help would be appreciated.

Thanks.

Upvotes: 2

Views: 1115

Answers (1)

Tony Ju
Tony Ju

Reputation: 15619

I didn't find any special column to distinguish the errors from webjobs if we don't custom the error in webjob. But we can call the api to know the status of the webjobs. You can follow this article step by step, I have tested it on my side.

The main steps are

  1. get the authorization header from the WebJobs REST API

  2. create a webtest using visual studio

  3. add availability tests

Note: It is not clear how to set the notification email in the article. Here is the steps for your reference. Go to the Alerts tab under Monitoring ->click Manage actions.

enter image description here

Choose your action group->choose Email/SMS/Push/Voice as the Action Type->set your email here.

enter image description here

Upvotes: 1

Related Questions