title | description | services | documentationcenter | author | manager | editor | ms.assetid | ms.service | ms.devlang | ms.topic | ms.tgt_pltfrm | ms.workload | ms.date | ms.author |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Testing a runbook in Azure Automation | Microsoft Docs |
Before you publish a runbook in Azure Automation, you can test it to ensure that works as expected. This article describes how to test a runbook and view its output. |
automation |
mgoedtel |
jwhit |
tysonn |
7f7db785-52c0-4613-aa12-b02fd32a5182 |
automation |
na |
article |
na |
infrastructure-services |
09/12/2016 |
magoedte;bwren |
When you test a runbook, the Draft version is executed and any actions that it performs are completed. No job history is created, but the Output and Warning and Error streams are displayed in the Test output Pane. Messages to the Verbose Stream are displayed in the Output Pane only if the $VerbosePreference variable is set to Continue.
Even though the draft version is being run, the runbook still executes the workflow normally and performs any actions against resources in the environment. For this reason, you should only test runbooks at non-production resources.
The procedure to test each type of runbook is the same, and there is no difference in testing between the textual editor and the graphical editor in the Azure portal.
You can work with any runbook type in the Azure portal.
- Open the Draft version of the runbook in either the textual editor or graphical editor.
- Click the Test button to open the Test blade.
- If the runbook has parameters, they will be listed in the left pane where you can provide values to be used for the test.
- If you want to run the test on a Hybrid Runbook Worker, then change Run Settings to Hybrid Worker and select the name of the target group. Otherwise, keep the default Azure to run the test in the cloud.
- Click the Start button to start the test.
- If the runbook is PowerShell Workflow or Graphical, then you can stop or suspend it while it is being tested with the buttons underneath the Output Pane. When you suspend the runbook, it completes the current activity before being suspended. Once the runbook is suspended, you can stop it or restart it.
- Inspect the output from the runbook in the output pane.
- To learn how to create or import a runbook, see Creating or importing a runbook in Azure Automation
- To learn more about Graphical Authoring, see Graphical authoring in Azure Automation
- To get started with PowerShell workflow runbooks, see My first PowerShell workflow runbook
- To learn more about configuring runboks to return status messages and errors, including recommended practices, see Runbook output and messages in Azure Automation