General Availability of Azure Automation extension for Visual Studio Code

  • Thread starter Thread starter Swatidevgan
  • Start date Start date
S

Swatidevgan

Visual Studio Code is a lightweight source code editor which runs on your desktop and is available for Linux, macOS, and Windows. It provides an industry leading creation & editing experience for languages and runtimes like PowerShell, Python etc. The extension offers you features for runbook management operations like editing runbook, triggering a job, tracking recent jobs, linking a schedule, asset management, local debugging etc. ensuring the developers and IT admins can author, debug, edit and manage automation runbooks without leaving the IDE (Visual Studio Code).



This extension leverages the Azure Account extension that provides a single Azure sign in and subscription filtering experience for all other Azure extensions. The extension also leverages the PowerShell extension that provides features like Syntax highlighting, IntelliSense for cmdlets, Local script debugging and many more features. You can also use Python extension like Python to use features such as IntelliSense, linting, debugging, code navigation, code formatting and more for Python scripts.



This extension has been available for a while and has registered over ~30K installs. It’s now ready for more exposure and usage with some improvements based on feedback as shared by the customers. We’ve built this experience for customers who heavily use the PowerShell ISE for writing runbooks instead of using the built-in browser-based interface for runbook authoring, while working with PowerShell cmdlets and Automation Assets. With a leg up to the current browser-based interface, the extension makes runbook developers more productive and reduces the E2E time for runbook management.



Key Features of the extension


  • Supports all the Automation – 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 runbook workers. You can execute runbooks locally also.
  • Supports Python positional parameters and PowerShell parameters for job tiggering.
  • Supports linking a Schedule to Runbook and creating webhook. Starting a job through Webhook is simplified.
  • You can manage the Automation Assets – certificates, variables, credentials, and connections.
  • You can see the recent last 10 jobs by right clicking on the job and select ‘Job Output’ from the menu.
  • You can debug PowerShell scripts locally.
  • You can compare local Runbook to the published or the draft runbook.
  • With this extension, here is the list of supported Runbook management operations.
    • Create Runbook
    • Fetch Draft Runbook
    • Fetch Published Runbook
    • Open Local
    • Compare Local Runbook
    • Upload As Draft
    • Publish Runbook
    • Delete Runbook.
Test Runbook and Jobs

  1. Run Local – Run local version of the automation job by right clicking the Runbook -> Run Local.
  2. 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).
  3. Start Automation Job – Start the automation job by right clicking in the Runbook properties -> Start Automation Job.
  4. Start Automation Test Job – Start the automation test job by right clicking in the Runbook properties -> Start Automation Test Job.
  5. 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

  1. 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.
  1. You can create, update, or view the properties of Assets - Certificates, Connections, Credentials, Variables and Delete assets from the extension.

medium?v=v2&px=400.png



Walkthrough of various extension operations can be found on the Extension Overview in the Visual Studio marketplace. Complete documentation can be found here.



Limitation


  • 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.
  • 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.
  • Creation of PowerShell 7.2 and python 3.10 not supported at present.

We are evaluating and will address these limitations in the future releases.



Feedback


Do share your review for us to improve the extension! We’ve already heard some great feedback about the extension helping users in the runbook authoring process. We hope you’ll try it out and let us know about your experience so we can continue to refine it.

Support for this extension is provided on our GitHub Issue Tracker. You can submit a bug report, a feature suggestion or participate in discussions.

Happy automating!

Just getting started with Azure Automation? Learn about the service here and follow Azure Automation on Twitter for the latest updates.

Continue reading...
 
Back
Top