Azure Automation runbook types
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||Based on Windows PowerShell and created and edited completely in graphical editor in Azure portal.|
|Graphical PowerShell Workflow||Based on Windows PowerShell Workflow and created and edited completely in the graphical editor in Azure portal.|
|PowerShell||Text runbook based on Windows PowerShell script.|
|PowerShell Workflow||Text runbook based on Windows PowerShell Workflow.|
|Python||Text runbook based on Python.|
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.
- 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
- Encourages modular programming
- Can't edit runbook outside of Azure portal.
- May require a Code activity containing PowerShell code to perform complex logic.
- 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 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.
- 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.
- Must be familiar with PowerShell scripting.
- Can't use parallel processing to perform multiple actions in parallel.
- Can't use checkpoints to resume runbook in case of error.
- PowerShell Workflow runbooks and Graphical runbooks can only be included as child runbooks by using the Start-AzureAutomationRunbook cmdlet which creates a new job.
Following are current known issues with PowerShell runbooks.
- PowerShell runbooks cannot retrieve an unencrypted variable asset with a null value.
- 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.
- Implement all complex logic with PowerShell Workflow code.
- Use checkpoints to resume runbook in case of error.
- Use parallel processing to perform multiple actions in parallel.
- Can include other Graphical runbooks and PowerShell Workflow runbooks as child runbooks to create high-level workflows.
- 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 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.
- Utilize the robust standard library of Python.
- Must be familiar with Python scripting.
- Only Python 2 is supported at the moment, meaning Python 3 specific functions will fail.
Following are current known issues with Python runbooks.
- In order to utilize third-party libraries, the runbook must be run on a Windows Hybrid Runbook Worker or Linux Hybrid Runbook Worker with the libraries already installed on the machine before the runbook is started.
You should take into account the following additional considerations when determining which type to use for a particular runbook.
- You can't convert runbooks from graphical to textual type or vice-versa.
- There are limitations using runbooks of different types as a child runbook. See Child runbooks in Azure Automation for more information.
- To learn more about Graphical runbook authoring, see Graphical authoring in Azure Automation
- To understand the differences between PowerShell and PowerShell workflows for runbooks, see Learning Windows PowerShell Workflow
- For more information on how to create or import a Runbook, see Creating or Importing a Runbook