Skip to content

Latest commit

 

History

History
43 lines (35 loc) · 3.49 KB

automation-testing-runbook.md

File metadata and controls

43 lines (35 loc) · 3.49 KB
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

Testing a runbook in Azure Automation

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.

To test a runbook in the Azure portal

You can work with any runbook type in the Azure portal.

  1. Open the Draft version of the runbook in either the textual editor or graphical editor.
  2. Click the Test button to open the Test blade.
  3. If the runbook has parameters, they will be listed in the left pane where you can provide values to be used for the test.
  4. 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.
  5. Click the Start button to start the test.
  6. 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.
  7. Inspect the output from the runbook in the output pane.

Next Steps