DevOps | Scripts | Automation

AzureAzure Automation

How to add Azure Automation Account Add-on to PowerShell ISE?

We can use Azure Automation account resources from the PowerShell ISE using the Azure Automation Account Toolkit add-on. To add the module in ISE, we need to install a module called ‘AzureAutomationAuthoringToolkit‘.

This module can be installed using PowerShell or PowerShell ISE but it always works with the PowerShell ISE.

You can check package details on PowerShell Gallery.

https://www.powershellgallery.com/packages/AzureAutomationAuthoringToolkit/0.2.3.9

To install the module, Open PowerShell or PowerShell ISE console, run the below command,

Install-Module -Name AzureAutomationAuthoringToolkit -Scope CurrentUser -Verbose -Force

Once the above command runs successfully, we can check if the module is installed or not using the below commad.

Get-Module AzureAutomationAuthoringToolkit -ListAvailable

You will get the output as shown below.

To import the module in ISE, we need to use below command.

Import-Module AzureAutomationAuthoringToolkit

Once you run the above command, ISE loads the Automation account Add-on.

Click on the Sign-In button and it will popup the Azure credential window.

Once you enter the correct credentials, there will be a list of subscription and Automation Accounts.

Select the appropriate subscription on which your runbooks reside and once you click on the Runbook (second tab), it will download all runbooks associated with the subscription.

You can create new, and download, delete, open and publish the existing runbook directly from ISE.

Here, we will download the “MyFirstRunbook-PowerShell” runbook and once you download it, you can see the option to open it in ISE.

You can test the workbook using the “Test Draft in Azure” button listed in the screenshot. If you have modified the existing workbook, click on the Upload Draft first to save the workbook. Upon clicking the Test button, you can see the test pane.

Click on the “Start New Job” button to test the workbook.

If the draft is created newly, you can publish the draft as well.