Raymond Raymond / Microsoft Azure

Azure Automation Account Runbooks

event 2021-12-24 visibility 345 comment 0 insights toc
insights Stats
Azure Automation Account Runbooks

Azure Automation Account is provided for process automations. Once an automation account is created, you can use it to create runbooks. It currently support 5 runbook types: Graphical (PowerShell via Azure Portal), Graphical PowerShell Workflow (PowerShell Workflow via Azure Portal), PowerShell, PowerShell Workflow and Python.

Azure runbooks usages

Azure runbooks can be used for many different types of automation tasks, for example, start or stop Azure VMs, auto-scale of your Azure SQL Database based on schedule, send emails, backup or delete blobs, etc.

You can find many different templates from the gallery.


This article shows you a simple PowerShell textbook runbook that ping Kontext website every hour to give you a high-level idea about what you can do with Azure automation account.

Create an automation account

The first step is to create an automation account. In Azure Portal, search for Automation Accounts and then click '+ Create' button to create an account. 


Create runbook

  1. Go to Process Automation section of the automation account blade
  2. Click Runbooks to view your existing runbooks or create a new runbook.
  3. Click button '+ Create a runbook'.
  4. Input the details.
  5. Click button 'Create' to complete the creation of the runbook.
  6. In the editor, input the PowerShell scripts:

  7. Click button 'Test pane' to test.
  8. Click button 'Start' to start the test.
  9. Once the test is completed, the result will show as the following screenshot:
  10. Go back to the editor and then click button 'Publish' to publish the runbook.
  11. Once it is published, you can run, edit or delete it from the runbook blade:

Create a scheduler

Once a runbook is created, you can create a scheduler for it.

  1. In the runbook blade, click Schedules under Resources category:
  2. Click button '+ Add a schedule'.
  3. Click 'Link a schedule to your runbook':
  4. Click a schedule or create a new one:
  5. Click button Ok to save the change.
  6. After the schedule is linked, you can see the next run timestamp based on the schedule settings:
  7. Once the runbook is executed, you can find the history in the Jobs section:
  8. Click one job, you will be able to see all the details including output and all other logs:

If you prefer Python, you can also use it to create runbooks. Enjoy process automation with Azure Automation Account!

More from Kontext
comment Comments
No comments yet.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts