Get started with Azure Automation
Microsoft Azure Automation provides a way for developers to automate the manual, long-running, error-prone, and frequently repeated tasks that are commonly performed in a cloud environment. You can create, monitor, manage, and deploy resources in your Azure environment using runbooks, which under the hood are Windows PowerShell workflows. To learn more about Automation, see the Automation Overview Guide.
This tutorial walks you through the steps to import a sample "Hello World" runbook into Azure Automation, execute the runbook, and then view its output.
Samples and utility runbooks
The Azure Automation team has created a number of runbook samples to help you get started with Automation. These samples cover basic Automation concepts and are intended to help you learn how to write your own runbooks.
The Automation team has also created utility runbooks that you can use as building blocks for larger Automation tasks.
It's a best practice to write small, modular, reusable runbooks. We also strongly recommend that you create your own utility runbooks for commonly used scenarios after you're familiar with Automation.
You can view and download the Automation team’s sample and utility runbooks on Script Center or import them directly from the Runbook Gallery.
The Automation community and feedback
Runbooks from the community and from other Microsoft teams are also published on Script Center and the Runbook Gallery.
Give us feedback! If you are looking for an Automation runbook solution or integration module, post a Script Request on the Script Center. If you have an idea for a new feature for Automation, post it on User Voice.
High-level steps for this tutorial
- Sign up for Automation preview
- Import Runbook from Runbook Gallery
- Publish Runbook
- Start Runbook
Sign up for the Azure Automation Preview
To start using Automation, you’ll need an active Azure subscription with the Microsoft Azure Automation preview feature enabled.
Create an Automation Account
Log in to the Azure Management Portal.
In the Management Portal, click Create an Automation Account.
If you’ve already created an automation account, you can skip to step 4.
On the Add a New Automation Account page, enter a name for the account, and then click the check mark.
Import Runbook from Runbook Gallery
On the Automation page, click the new account you just created.
Click New > Runbook > From Gallery.
Select the Tutorial category and then Hello World for Azure Automation. Click the right arrow button.
Review the contents of the runbook and then click the right arrow button.
Review the details of the runbook and then click the check mark button.
When the runbook has finished importing, click Write-HelloWorld.
Click AUTHOR, and then click DRAFT.
You can modify the contents of a runbook in Draft mode. For this runbook, you don’t need to make any modifications.
Click PUBLISH to promote the runbook so it's ready for production use.
When you are prompted to save and publish the runbook, click Yes.
With the Write-HelloWorld runbook open, click START.
On the Specify the runbook parameter values page, type a Name that will be used as an input parameter for the Write-HelloWorld.ps1 script, and then click the check mark.
Click JOBS to check the status of the runbook job you just started, and then click the timestamp in the JOB START column to view the job summary.
On the SUMMARY page you can see the summary, input parameters, and output of the job.
Managing Azure Services from a Runbook
The example above shows a simple runbook that does not manage Azure services. The Azure cmdlets require authentication to Azure. You can follow the instructions at Azure Automation: Authenticating to Azure using Azure Active Directory in order to configure your Azure subscription for management through Azure Automation.