Azure Automation + Runbooks
Intro
Azure Automation delivers a cloud-based automation and configuration service that supports consistent management across your Azure and non-Azure environments. It comprises process automation, configuration management, update management, shared capabilities, and heterogeneous features.
Documentation
Lots of code examples: Browse code samples
Tips and Tidbits
You need to create an automation account first.
Automation account names are unique per region and resource group.
Names for Automation accounts that have been deleted might not be immediately available.
The name can contain only letters, numbers, and hyphens. The name must start with a letter, and it must end with a letter or a number. The account name length must be from 6 to 50 characters
When you start Azure Automation for the first time, you must create at least one Automation account.
Automation accounts allow you to isolate your Automation resources, runbooks, assets, and configurations from the resources of other accounts
Azure Automation allows you to automate frequent, time-consuming, and error-prone cloud management tasks by using PowerShell, PowerShell Workflow, and graphical runbooks
Automation executes your runbooks based on the logic defined inside them.
If a runbook is interrupted, it restarts at the beginning. This behavior requires you to write runbooks that support being restarted if transient issues occur.
Each job accesses Azure resources by making a connection to your Azure subscription.
The job can only access resources in your data center if those resources are accessible from the public cloud.
You can't convert runbooks from graphical to text type, or the other way around
Run As accounts in Azure Automation provide authentication for managing resources using Automation runbooks and other Automation features.
When you create a Run As account, it performs the following tasks:
Creates an Azure AD application with a self-signed certificate, creates a service principal account for the application in Azure AD, and assigns the Contributor role for the account in your current subscription
Where to run runbooks
Runbooks in Azure Automation can run on either an Azure sandbox or a Hybrid Runbook Worker.
When runbooks are designed to authenticate and run against resources in Azure, they run in an Azure sandbox, which is a shared environment that multiple jobs can use.
Jobs using the same sandbox are bound by the resource limitations of the sandbox.
You can use a Hybrid Runbook Worker to run runbooks directly on the computer that hosts the role and against local resources in the environment.
Automation sandboxes support .NET Framework 4.7.2, and upgrading to a different version is not supported.
The Azure sandbox environment does not support interactive operations.
It prevents access to all out-of-process COM servers, and it does not support making WMI calls to the Win32 provider in your runbook.
If you need to create temporary files as part of your runbook logic, you can use the Temp folder (that is,
$env:TEMP
) in the Azure sandbox for runbooks running in Azure. The only limitation is you cannot use more than 1 GB of disk space, which is the quota for each sandbox