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.
The Automation community and feedback
Runbooks from the community and from other Microsoft teams are also published on Script Center.
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
- Download a sample runbook
- Import, run, and view the output of the sample 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.
Download a sample runbook from the Script Center
Go to Script Center, and then click Hello World for Azure Automation.
Click the file name, Write-HelloWorld.ps1, next to Download, and then save the file to your computer.
Import, run, and view the sample runbook in Azure Automation
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.
On the Automation page, click the new account you just created.
Browse to the Write-HelloWorld.ps1 script you downloaded, and then click the check mark.
Click AUTHOR, and then click DRAFT. For this runbook, you don’t need to make any modifications.
You can now see the contents of Write-HelloWorld.ps1. You can modify the contents of a runbook in Draft mode.
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.
Click PUBLISHED, and then 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.