question

AConfusedUser avatar image
0 Votes"
AConfusedUser asked AndreasBaumgarten answered

Runbook Job - how to alert on error?

Using Automation I created a runbook and scheduled it to run.

The job runs and if there is an error in the "Errors" tab, I do not get any sort of notification.

The job status is completed but inside the job (Output, Errors, Warnings, All Logs, Exception) I want to be alerted when an Error entry is captured.

How can I accomplish this?

Thank you

azure-automation
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AndreasBaumgarten avatar image
0 Votes"
AndreasBaumgarten answered AConfusedUser edited

Maybe this is helpful to create alerts on failed Azure Automation Runbooks:
https://docs.microsoft.com/en-us/azure/automation/automation-alert-metric


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Andreas Baumgarten

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thank you, I tried that but it only seems to work if the runbook Status fails.

In this case the status =completed but the Errors view will show an error


54581-image.png


0 Votes 0 ·
image.png (11.3 KiB)
AndreasBaumgarten avatar image
0 Votes"
AndreasBaumgarten answered

Than maybe this might be an option:
https://docs.microsoft.com/en-us/azure/automation/automation-manage-send-joblogs-log-analytics#find-all-jobs-that-have-completed-with-errors

Based on Log Analytics queries it's possible to fire an alert:
https://docs.microsoft.com/en-us/azure/azure-monitor/platform/alerts-log


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Andreas Baumgarten

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.