Azure Automation - Publish Runbook

In our previous article (listed below as a link), we have learned the basics of Azure Automation and how to create the basic Runbook, which is authored using PowerShell. In this article, we will learn how to publish the Runbook.

Navigate to the HelloWorld Runbook by clicking on the Automation account, click the Runbooks of the essentials tab of the account and select the required Runbook. In this case, HelloWorld is shown below:

Runbook

If you observe the essentials tab of the “HelloWorld” in Runbook, a few icons highlighted below in Red are disabled as the Runbook is not yet published.

HelloWorld

  • Start – Helps to start the Runbook
  • View – Helps to To view the published source code of the Runbook
  • Schedule – You can schedule the execution of Runbook on a regular basis. We will see this in one of our future articles.
  • Webbook – You can trigger the Runbook, based on a HTTP Request
  • Export – Helps to export the Runbook code in the form of PowerShell script.

Basically, you can have all the actions, shown above, only when the Runbook is published. By default, when you author Runbook, it will be in the draft mode. You can run it by clicking on the “Edit” and then going to “Test Pane”, which was explained in our previous article “Azure Automation – Author Runbook, using PowerShell - Hello World (URL Here)”.

Let’s go ahead and publish the “HelloWorld” Runbook by clicking the “Edit” icon and “Publish”, as shown below:

publish

A confirmation message will be displayed, as shown below:

confirmation

Click “YES”, as shown above.

In just a few seconds, Runbook gets published and all the icons in the Runbook essentials blade will be enabled, as shown below:

essentials

After publishing Runbook, if you go back to the listing of all Runbooks, the “Authoring Status” of the HelloWorld Runbook is now “Published”, as shown in the below screenshot:

Status
Now, go back to the “HelloWorld” Runbook’s essentials blade and click “Start” button.

HelloWorld

Clicking “Start” button will prompt for a confirmation box, as shown in the below screenshot:

Start

Click “YES” and after few seconds, the output pane will be displayed, as shown below, where the status of Runbook execution is displayed as  “Queued”.

Queued

It will go into “Running” state, as shown below:

Running

Finally, the status of Runbook is “Completed”, as shown below:

Completed

In order to view the output of Runbook, click the “Output”, as shown below:

Output

The output page displays the output of Runbook, as shown below:

Output


Similar Articles