Azure Automation Schedule Jobs

Azure Automation Schedule Jobs

This is a follow-up post which covered a brief introduction to Microsoft Azure Automation and can be found here.

Within this post I will cover how to publish a workbook, schedule the execution of workbooks, enable detailed logging and a quick view at the dashboard.

Azure Automation Schedule Jobs: The Steps

Scheduling the execution of a workbook (descriptively named Schedule in Microsoft Azure) requires that the workbook has been published, which is basically a flag. To publish a workbook within the Portal, open the Workbook, open the tab called AUTHOR and click PUBLISH, which can be found at the bottom of the screen. Nothing special will happen at this point, the execution context of the script will stay the same. Therefore it’s important to note that there isn’t a sandbox like environment where you can test Workbooks isolated from your Azure assets.

Windows_Azure_Automation_Job_1

After publishing the Workbook, you will be able to alter and test a new version of the Workbook and publish this version when ready. I wish it was possible to compare version of scripts and add notes for every publish version. The authoring experience is very pleasant, however I prefer to build and pre-test my scripts locally including the process of annotating changes and storing the Workbooks within a source repository.

Scheduling the execution of workbooks

Scheduling the execution of a workbook can be performed within the portal by opening schedule tab of the workbook. Here you can create a new schedule or reuse an existing schedule. The schedule options are rather limited compared with SQL server scheduler or windows scheduler as you can see below.

Windows_Azure_Automation_Job_2

Note: At this point it’s even possible to link multiple schedules to a workbook in case the default scheduler options aren’t providing the desired choices or perhaps other special cases.

Windows Azure Automation Dashboards

Windows Azure Automation includes a very helpful dashboard to monitor the execution workbooks, including running and historical data. An important thing to know is that the execution of a workbook is called a Job and each job will walk through a predefined set of statuses before completion. The statuses are quite descriptive as can be seen below.

• QUEUED
• RUNNING
• FAILED
• STOPPED
• SUSPENDED
• COMPLETED

The dashboard can be opened on Windows Azure Automation Account level or on an individual workbook. And also enables the option to execute a workbook directly (create a job) without the need for creating/linking a schedule. Jobs created Ad Hoc will be included within the job history.

Windows_Azure_Automation_Job_3

A very welcome feature is the option to inspect the job history details; this can be performed by clicking on one of the past jobs within the dashboard page.

Windows_Azure_Automation_Job_4

Within the job details / summary page you will be able to review the execution context and logged output in a flat format or as a stack trace as found on the HISTORY tab. This will also include the option to view the Runbook source used for this job.

Windows_Azure_Automation_Job_5

Post Navigation