Alerting on failed WebJobs RRS feed

  • Question

  • Hi,

    is there any way of alerting , via email when an Azure Website Webjob fails ?

    Been playing with the *WebSiteJoB* cmdlets but obviously would like a built in / automated way to gen emai



    Saturday, March 22, 2014 1:47 PM

All replies

  • It's not supported today, but is an interesting idea. What kind of jobs are you working with that you'd like to get notifications for? Are they Continuous or triggered (i.e. manual/scheduled)?
    • Edited by David Ebbo Monday, March 24, 2014 11:37 PM
    Sunday, March 23, 2014 5:13 AM
  • Hi David,

    Thanks for quick reply.

    Short Version : make it like SQL Server Agent :-)

    Long Version :

    We have started using triggered / scheduled jobs to do Operational type tasks

    1.  For example we have a Daily job that against our WASD db  :

    • does some database maint (Reindex / Update stats)
    • checks the latest Blob bacpac backup is current (thinking about extending to push to test / staging db)
    • Gets some stats about DB / Customers / orders etc

    and sends details in an email

    2. Also have a job to shutdown all Dev / Test Virtual Machines at end of working day (using new Management Libraries) to save a bit of cash

    3. Will be creating some more business type jobs soon - ie end of day / month reports type stuff

    so want to be notified on Failure by email (and optionally success). Ideally it would be great to have concept of Operators where you could create groups of people / email addresses and then assign that group to be emailed when WebJob x fails .

    We can obviously put retry logic above code that detects failure / does same , but then we have to think about managing recipients somehow and wont account for all possible failure situations.



    Sunday, March 23, 2014 8:04 AM
  • Thanks for the details Andy. The plan would be to do something similar to this. We are tracking this here, so feel free to follow that issue and comment further there.
    Monday, March 24, 2014 11:40 PM
  • Hi David,

    I see , so would we have to sign up for that service, or would just a similar idea be baked into Azure ?

    You said "We are tracking this here" - was here meant to have a link on it

    Actually thought about this a bit more , and my original thinking / SQL Agent thinking was a bit 90's !

    We are using SendGrid for email , so all we would need would be a way of on failure posting to their API URL with the ability to combine some tokenised variables from the Web Job (ie Job Name, Date , possibly Log file as attachment ) with hard coded values (like To Address / Sendgrid User name and password)in the url




    Tuesday, March 25, 2014 5:56 AM
  • Sorry for not replying earlier. We added support for this, per this change. Here is a post that discusses it.

    Basically, each time a job completes, a request can be sent to a URL of your choice, containing a payload that has all the relevant fields.

    You can use a site like Zapier to handle the request, or have it be handled by some arbitrary other endpoint.

    Could you give this a try and let us know how that works for you?


    Thursday, April 10, 2014 12:42 AM