Microsoft Azure Automation provides a way for users 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 are based on Windows PowerShell workflows. In this guide, you will go through a tutorial for running a simple example runbook. You will then find resources for exploring more advanced capabilities of the service.
This tutorial walks you through creating an automation account, importing a sample "Hello World" runbook into Azure Automation, executing that runbook, and then viewing its output.
This tutorial uses a simple runbook that does not require access to Azure resources. See the Next Steps section of this guide for information on configuring authentication in Azure Automation which is required for most runbooks.
An Automation Account is a container for your Azure Automation resources: it provides a way to separate your environments or further organize your workflows. For more information, see Automation Accounts in the Automation Library. If you've already created an automation account, you can skip this step.
Log in to the Azure Management Portal.
In the Management Portal, click Create an Automation Account.
On the Add a New Automation Account page, enter a name and pick a region for the account. The region specifies where the Automation resources in the account will be stored. This will not affect the functionality of your account, but your runbooks may execute faster if your account region is near where your other Azure resources are stored. When you're ready, click the check mark.
The Runbook Gallery includes sample runbooks that you can import directly into an Azure Automation account, allowing you to leverage the work of other Azure Automation and PowerShell users. In this step, you will use the gallery to import the "Hello World" sample runbook.
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 runbook details, and then click the check mark button.
The runbook is first imported in Draft mode. This means you can continue to do work on it before authorizing it as a new version that can be run. Since this sample runbook requires no additional configuration, you will now publish it as-is. For more information, see Publishing a Runbook.
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, marking it ready for production use.
When you are prompted for confirmation, 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.
Congratulations! You have finished the tutorial.
A variety of other resources are available for you to learn more about Azure Automation and creating your own runbooks.
Microsoft and the Azure Automation community provide sample runbooks, which can help you get started creating your own solutions, and utility runbooks, which you can use as building blocks for larger automation tasks. You can either download these runbooks from Script Center or import them directly into Azure Automation using the Runbook Gallery.
Give us feedback! If you are looking for an Azure Automation runbook solution or an integration module, post a Script Request on Script Center. If you have feedback or feature requests for Azure Automation, post them on User Voice. Thanks!