Azure Automation runbook types

In this article

Azure Automation supports several types of runbooks that are briefly described in the following table. The sections below provide further information about each type including considerations on when to use each.

Graphical runbooks

Graphical and Graphical PowerShell Workflow runbooks are created and edited with the graphical editor in the Azure portal. You can export them to a file and then import them into another automation account, but you cannot create or edit them with another tool. Graphical runbooks generate PowerShell code, but you can't directly view or modify the code. Graphical runbooks cannot be converted to one of the text formats, nor can a text runbook be converted to graphical format. Graphical runbooks can be converted to Graphical PowerShell Workflow runbooks during import and vice-versa.

Advantages

Visual insert-link-configure authoring model

Focus on how data flows through the process

Visually represent management processes

Include other runbooks as child runbooks to create high-level workflows

Limitations

Can't view or directly edit the PowerShell code that is created by the graphical workflow. Note that you can view the code you create in any Code activities.

PowerShell runbooks

PowerShell runbooks are based on Windows PowerShell. You directly edit the code of the runbook using the text editor in the Azure portal. You can also use any offline text editor and import the runbook into Azure Automation.

Advantages

Implement all complex logic with PowerShell code without the additional complexities of PowerShell Workflow.

Runbook starts faster than PowerShell Workflow runbooks since it doesn't need to be compiled before running.

Known Issues

PowerShell runbooks cannot retrieve a variable asset with ~ in the name.

Get-Process in a loop in a PowerShell runbook may crash after about 80 iterations.

A PowerShell runbook may fail if it attempts to write a very large amount of data to the output stream at once. You can typically work around this issue by outputting just the information you need when working with large objects. For example, instead of outputting something like Get-Process, you can output just the required fields with Get-Process | Select ProcessName, CPU.

PowerShell Workflow runbooks

PowerShell Workflow runbooks are text runbooks based on Windows PowerShell Workflow. You directly edit the code of the runbook using the text editor in the Azure portal. You can also use any offline text editor and import the runbook into Azure Automation.

Advantages

Can include other Graphical runbooks and PowerShell Workflow runbooks as child runbooks to create high-level workflows.

Limitations

Author must be familiar with PowerShell Workflow.

Runbook must deal with the additional complexity of PowerShell Workflow such as deserialized objects.

Runbook takes longer to start than PowerShell runbooks since it needs to be compiled before running.

PowerShell runbooks can only be included as child runbooks by using the Start-AzureAutomationRunbook cmdlet which creates a new job.

Python runbooks

Python runbooks compile under Python 2. You can directly edit the code of the runbook using the text editor in the Azure portal, or you can use any offline text editor and import the runbook into Azure Automation.

Advantages

Utilize the robust standard library of Python.

Limitations

Must be familiar with Python scripting.

Only Python 2 is supported at the moment, meaning Python 3 specific functions will fail.