How to create Azure Automation runbook

Today I will not show you any script, but will guide you how to create Azure Automation runbook.

For those who didn’t heard about Azure Automation I strongly recommend to check Microsoft documentation – link.
To make long story short – Azure Automation is the service in Azure cloud, which allow to automate repetitive tasks in your environment using Powershell :).
Not only standard work which can be done on VMs, but it can automate tasks for other services.

How this work?
First of all you should have access to active Azure subscription.
Login to portal.azure.com and in the lookup field type Automation Accounts

In this step you must create Automation Account under which your runbook will be created.
Provide all necessary information and choose region which is most suitable for you.

Once automation account is created you can create your own runbook. But before that I recommend to check share resources section under your automation account.
This section store information which will be available across all runbooks created under automation account.
From my perspective most usefull resources are:
Modules – same as in your “computer” version of Powershell. To work with some products you need specific module to be installed. All modules are available in galerry, so insallation is very quick
Credentials – you shouldn’t store your credentials directly in script. This section store credentials in encrypted way.
Variables – if you want to use same variable in few runbooks it is the best place to do it.

Runbook creation
To create new runbook from Process automation section select Runbooks

From newly open blade select Add a runbook if you want to create new runbook or Browse gallery if you want to use runbook which was already created by someone else and uploaded to gallery.

In next step (if you choose add runbook option) you must provide runbook name (unique in automation account) and runbook type.
Usually I choose Powwershell as a type of runbook, however if you want to use graphic runbook is not very complicated 😉

Once new runbook is created you can write Powershell script.
Use Test pane section during script creation, it will help you to find some bugs 🙂

If you have any questions please leave a comment, we will try to help you 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.