Skip to content

Commit 143bc23

Browse files
authored
Merge pull request #221832 from SnehaSudhirG/18Dec-RunbookAuthoring
added concept, how-to and updated toc
2 parents 17dd271 + 2ab7c4e commit 143bc23

17 files changed

+211
-0
lines changed

articles/automation/TOC.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
href: /powershell/dsc/overview
4444
- name: Automation network configuration details
4545
href: automation-network-configuration.md
46+
- name: Azure Automation extension for Visual Studio Code
47+
href: automation-runbook-authoring.md
4648
- name: Security
4749
items:
4850
- name: Security controls by Azure Policy
@@ -98,6 +100,8 @@
98100
href: delete-run-as-account.md
99101
- name: Manage Run As account
100102
href: manage-runas-account.md
103+
- name: Use Automation extension for Visual Studio Code
104+
href: how-to/runbook-authoring-extension-for-vscode.md
101105
- name: Configure authentication with Amazon Web Services
102106
href: automation-config-aws-account.md
103107
- name: Configure authentication with Azure AD
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title: Runbook authoring using VS code in Azure Automation
3+
description: This article provides an overview authoring runbooks in Azure Automation using the visual studio code.
4+
services: automation
5+
ms.subservice: process-automation
6+
ms.date: 01/10/2023
7+
ms.topic: conceptual
8+
ms.custom: devx-track-azurepowershell
9+
---
10+
11+
# Runbook authoring through VS Code in Azure Automation
12+
13+
This article explains about the Visual Studio extension that you can use to create and manage runbooks.
14+
15+
Azure Automation provides a new extension from VS Code to create and manage runbooks. Using this extension, you can perform all runbook management operations such as, creating and editing runbooks, triggering a job, tracking recent jobs output, linking a schedule, asset management, and local debugging.
16+
17+
## Prerequisites
18+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
19+
- [Visual Studio Code](https://code.visualstudio.com/).
20+
- PowerShell modules and Python packages used by runbook must be locally installed on the machine to run the runbook locally.
21+
22+
## Supported operating systems
23+
24+
The test matrix includes the following operating systems:
25+
1. **Windows Server 2022** with Windows PowerShell 5.1 and PowerShell Core 7.2.7
26+
1. **Windows Server 2019** with Windows PowerShell 5.1 and PowerShell Core 7.2.7
27+
1. **macOS 11** with PowerShell Core 7.2.7
28+
1. **Ubuntu** 20.04 with PowerShell Core 7.2.7
29+
30+
>[!NOTE]
31+
>- The extension should work anywhere in VS Code and it supports [PowerShell 7.2 or higher](https://learn.microsoft.com/powershell/scripting/install/PowerShell-Support-Lifecycle?view=powershell-7.3). For Windows PowerShell, only version 5.1 is supported.
32+
>- PowerShell Core 6 is end-of-life and not supported.
33+
34+
35+
## Key Features
36+
37+
- **Simplified onboarding** – You can sign in using an Azure account in a simple and secure way.
38+
- **Multiple languages** - Supports all Automation runtime stack such as PowerShell 5, PowerShell 7, Python 2, and Python 3 Runbooks.
39+
- **Supportability**- Supports test execution of job, publishing Automation job and triggering job in Azure and Hybrid workers. You can execute runbooks locally.
40+
- Supports Python positional parameters and PowerShell parameters to trigger job.
41+
- **Webhooks simplified** – You can create a webhook, start a job through a webhook in simpler way. Also, support to link a schedule to a Runbook.
42+
- **Manage Automation Assets** – You can perform create, update, and delete operation against assets including certificates, variables, credentials, and connections.
43+
- **View properties** – You can view the properties and select Hybrid worker group to execute hybrid jobs and view the recent last 10 jobs executed.
44+
- **Debug locally** - You can debug the PowerShell scripts locally.
45+
- **Runbook comparison** - You can compare the local runbook to the published or the draft runbook copy.
46+
47+
## Key Features of v1.0.8
48+
49+
- **Local directory configuration settings** - You can define the working directory that you want to save runbooks locally.
50+
- **Change Directory:Base Path** - You use the changed directory path when you reopen Visual Studio code IDE. To change the directory using the Command Palette, use **Ctrl+Shift+P -> select Change Directory**. To change the base path from extension configuration settings, select **Manage** icon in the activity bar on the left and go to **Settings > Extensions > Azure Automation > Directory:Base Path**.
51+
- **Change Directory:Folder Structure** - You can change the local directory folder structure from *vscodeAutomation/accHash* to *subscription/resourceGroup/automationAccount*. Select **Manage** icon in the activity bar on the left and go to **Settings > Extensions > Azure Automation > Directory:Folder Structure**. You can change the default configuration setting from *vscodeAutomation/accHash* to *subscription/resourceGroupe/automationAccount* format.
52+
>[!NOTE]
53+
>If your automation account is integrated with source control 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//subscriptionName//resourceGroupName//automationAccountName//runbookname.ps1*.
54+
- **Runbook management operations** - You can create runbook, fetch draft runbook, fetch published runbook, open local runbook in the editor, compare local runbook with a published or draft runbook copy, upload as draft, publish runbook, and delete runbook from your Automation account.
55+
- **Runbook execution operations** - You can run a local version of Automation jobs such as, Start Automation jobs, Start Automation test job, view job outputs and run local version of the PowerShell Runbook in debug mode by allowing you to add breakpoints in the script.
56+
>[!NOTE]
57+
> Currently, we support the use of internal cmdlets like `Get-AutomationVariable` only with non-encrypted assets.
58+
59+
- **Work with schedules, assets and webhooks** - You can view the properties of a schedule, delete schedule, link schedule to link a schedule to a runbook.
60+
- **Add webhook** - You can add a webhook to the runbook.
61+
- **Update properties of assets** - You can create, update, view properties of assets such as Certificates, Connections, Credentials, Variables and Deletion of assets from the extension.
62+
63+
64+
## Limitations
65+
Currently, the following features aren't supported:
66+
67+
- Creation of new schedules.
68+
- Adding new Certificates in Assets.
69+
- Upload Modules (PowerShell and Python) packages from the extension.
70+
- Auto-sync of local runbooks to Azure Automation account. You will have to perform the operation to **Fetch** or **Publish** runbook.
71+
- Management of Hybrid worker groups.
72+
- Graphical runbook and workflows.
73+
- For Python, we don't provide any debug options. We recommend that you install any debugger extension in your Python script.
74+
- Currently, we support only the unencrypted assets in local run.
75+
76+
## Next steps
77+
78+
- For Runbook management operations and to test runbook and jobs, see [Use Azure Automation extension for Visual Studio Code](../automation/how-to/runbook-authoring-extension-for-vscode.md)
79+
89.9 KB
Loading
89.9 KB
Loading
1.77 MB
Loading
1.77 MB
Loading
68.9 KB
Loading
68.9 KB
Loading
101 KB
Loading
101 KB
Loading

0 commit comments

Comments
 (0)