Azure Automation: Author Runbook Using PowerShell - Hello World

In our previous article (listed below), we have learned the basics of Azure Automation. In this article, we will learn how to create a basic Runbook.

Navigate to the essentials tab of the Azure Automation account by clicking the account name in the list of the Azure Automation Account, shown below:

Click the account and you will be taken to the essentials tab of the Automation Account, as shown below:


By default, the following are created.

  1. 2 Runbooks
  2. 17 Assets

Click Runbooks tile, as shown in the above screenshot. You will be taken to the list of Runbooks that were already created.

Now, click “Add a runbook” link, as shown in the above screenshot:

Add a runbook

There are two methods, using which, you can create Runbooks. Let’s select “Quick Create” and provide the following values.

  1. Name: Name of the Runbook that we would like to create.
  2. Runbook type: For now, select “PowerShell” as the runbook type
  3. Description: Provide some meaningful description.

Click “Create”. In just a couple of seconds, the new Runbook named “HelloWorld” is created, as shown below:

Please note that the “Authoring Status” of the new Runbook is “New”. As soon as you create Runbook, it will be opened and go to edit state, as shown below:


The highlighted part in the above screenshot is where you author your PowerShell code for the current Runbook.

Also, in the left hand section of the “Edit PowerShell runbook” blade, you will see the existing Runbooks, along with the Assets.


This means you can use these Runbooks and the assets; while authoring the current Runbook.

Let’s write some basic PowerShell code that writes the output “Hello World”, as shown below:

Hello World

Now, click “Test Pane”. You will be taken to a new blade, where you can test your Runbook, as shown below:


Now, click “Start” button. Clicking “Start” button will submit RunBook to the Azure Automation Worker Server, which is responsible for executing Runbook. As shown below, after clicking the “Start” button, our “HelloWorld” Runbook is queued for the processing.


After a few seconds, the states get changed from “Queued” to “Started” followed by “Running” and once the processing is complete; the output is shown below:


That’s it. We have authored our first HelloWorld Runbook, using Azure Automation – PowerShell.