Use the Azure Automation extension to quickly create and manage runbooks directly from VS Code. You can perform all runbook management operations like creating runbooks, Editing Runbook , Triggering a Job , tracking Recent Jobs outputs , Linking a schedule , Asset management and Local debugging - and more using this extension.
More control over local directory of Runbooks via Extension Configurations
Diff Checking(Compare) made easy from right click menu of Runbook
Debug Support for PowerShell Runbooks (usage noted below)
Key Features of the extension
Allows Simple & Secure Azure Account Login, directly with browser integration. Allows Simple & Secure Azure Account Login, directly with browser integration . This extension uses the Azure Account extension that provides a single Azure sign in and subscription filtering experience. There are multiple commands accessible via the command palette that may be used to sign into & sign out of Azure. Read here for more details.
Supports all the automation runtime stack – PowerShell 5, PowerShell 7, Python 2 and Python3 Runbooks
Supports test execution of job , publishing Automation Job and triggering job in Azure as well as Hybrid workers. You can execute runbooks locally also.
Supports Python Positional Parameters and PowerShell Parameters for job Triggering
Support to link a Schedule to a Runbook and Create a Webhook. Starting a job through a Webhook is simplified.
Manage the Automation Assets – certificates, variables, credentials, and connections. You can perform create, update, and delete operation against assets.
You can view the properties and select Hybrid worker group for executing the hybrid jobs.
You can see the recent last 10 jobs executed.
You can debug PowerShell scripts locally.
You can compare local Runbook to the published or the draft runbook copy.
An Azure subscription. If you don't have an Azure subscription, create a free account before you begin.
Required PowerShell modules and Python packages used by the runbook must be locally installed on the machine for running the runbook locally.
Supported Operating Systems
The extension should work anywhere VS Code itself and PowerShell Core 7.2 or higher is supported. For Windows PowerShell, only version 5.1 is supported. Please note that PowerShell Core 6 is end-of-life and so not supported. Our test matrix includes the following:
Windows Server 2022 with Windows PowerShell 5.1 and PowerShell Core 7.2.7
Windows Server 2019 with Windows PowerShell 5.1 and PowerShell Core 7.2.7
macOS 11 with PowerShell Core 7.2.7
Ubuntu 20.04 with PowerShell Core 7.2.7
Local Directory operation
Change Directory(Base Path) - Define the working directory you want to save runbooks locally -> From Command Palette (Ctrl+ shift + P -> select Change Directory ). The changed directory path would be used even when you re-open Visual Studio code IDE. You can also change the Base path from Extension configuration settings. Click on Manage Icon in VSCode on the bottom left corner -> Settings ->WorkSpace -> Extensions -> Azure Automation - > Directory: Base Path.
Change Directory:Folder Structure - Allows you to change the local directory folder structure from vscodeAutomation/accHash to subscription/resourceGroup/automationAccount . Click on Manage Icon in VSCode on the bottom left corner -> Settings -> WorkSpace -> Extensions -> Azure Automation -> Directory: Folder Structure.
Default Configuration setting is "vscodeAutomation/accHash" which can be changed to "subscription/resourceGroup/automationAccount" format.
If your automation account is integrated with source control, then you can provide the runbook folder path of your GitHub repo as the directory path. For example: changing directory to "C:\abc" would store runbooks in "C:\abc\vscodeAutomation.." or "C:\abc\subscription\resourceGroup\automationAccount\runbookname.ps1"
Runbook management operations
Create Runbook – Create a New Runbook in the Automation Account by right clicking on ‘Runbooks’ title node and selecting Create Runbook.
Fetch Draft Runbook – Replace the content of the Local Runbook with draft version from the Automation Account by right clicking on the selected Runbook and Select Fetch Draft Runbook.
Fetch Published Runbook – Replace the content of Local Runbook with the published version from the Automation Account by right clicking on the selected Runbook and Select Fetch Published Runbook.
Open Local – Open the Local Runbook in the Editor by right Clicking on the selected Runbook properties and Select Open Local.
Compare Local Runbook(Diff Checking) - This allows you to compare Local Runbook with the Published or Draft Runbook copy. You can visualize the change in the code side by side between the local runbook copy and the published or draft copy. Compare by right clicking on Runbook properties and selecting Compare Local Runbook.
Upload As Draft – Save a local copy of your Runbook as draft in Automation Account by right clicking on the Runbook properties and Select Upload As Draft.
Publish Runbook – Publish the local copy of your Runbook in Automation Account by right clicking on the Runbook properties and selecting Publish Runbook.
Delete Runbook – Delete a Runbook from Automation Account by right clicking on the selected Runbook and selecting Delete Runbook.
Test Runbook and Jobs
Run Local – Run local version of the automation job by right clicking the Runbook -> Run Local.
Run Local in Debug Mode - Run local version of the PowerShell Runbooks in debug mode by allowing you to add breakpoints in the script. This provides support for using internal cmdlets like Get-AutomationVariable also (non-encrypted assets only supported currently). Select Run Local in Debug Mode from the Runbook right-click menu.
Start Automation Job – Start the automation job by right clicking in the Runbook properties -> Start Automation Job.
Start Automation Test Job – Start the automation test job by right clicking in the Runbook properties -> Start Automation Test Job.
Job Output – When a job is created , you can track the job output by clicking on Job Output option or you can go to Recent Jobs and right click to select Job Output . It polls the service every 5 seconds to show the job Output.
Work with Schedules, Assets and webhook
You can View the properties of a schedule and Delete Schedule.
Link Schedule – You can link a schedule to the runbook by right clicking on the Runbook properties menu and selecting Link Schedule. It supports params and runOn option.
Add New Webhook – You can add a webhook to the runbook by right clicking on the Runbook properties menu and selecting Add New Webhook. It supports params and runOn option.
You can create, update, or view the properties of Assets - Certificates, Connections, Credentials, Variables and Delete assets from the extension.
Limitation in the current release
The below limitations would be addressed in the future releases of the extension-
Creation of new Schedules is not supported.
Adding new Certificate in Assets is not supported.
Uploading Modules (PowerShell & Python Packages) from the extension is not supported.
Currently there is no auto-sync of local runbooks to Azure Automation Account Runbooks. You will have to perform the operation to Fetch or Publish runbook.
Management of Hybrid Worker Groups is not supported.
Graphical runbook and workflows are currently not supported.
For python currently we do not provide any debug options. It should be performed by the user as they do in any python script by installing any debugger extension.
Currently we only support unencrypted assets in local run.
Do share your review for us to improve the extension!
VS Code collects usage data and sends it to Microsoft to help improve our products and services. Read our privacy statement to learn more. If you don't wish to send usage data to Microsoft you can set the telemetry.enableTelemetry setting to false. Learn more in our FAQ.