
close
close
In this post, I will explain how you can use the Azure Portal to deploy Azure Automation, install additional PowerShell modules, and ensure that all PowerShell modules are up to date.
As always with an Azure “how to” post, Microsoft will probably change the user interface/steps as soon as this post is submitted. The changes will probably be minor, so you should be still able to get through the process with this guide.
Unfortunately, some of the nomenclature in Azure Automation is confusing. An Automation Account is a bucket/engine for storing/running automation runbooks (scripts). It is not actually a user account in the way that the name would suggest!
Creating an Automation Account is pretty simple. Note that Automation is only available in some of the Azure regions but this has no impact on where you can use Automation. For example, I can deploy Azure Automation in one region and execute runbooks against resources in another region.
Log into the Azure Portal, expand the navigation bar, search for Automation, select Automation Accounts, and then click Add. Enter the following details:
advertisment
Creating a New Azure Automation Account [Image Credit: Aidan Finn]
A Newly Created Automation Account and Sample Runbooks [Image Credit: Aidan Finn]
I have found in the past that Automation Accounts can be deployed by Azure with out-of-date PowerShell modules. That is not great because this will prevent Azure PowerShell-based runbooks from executing correctly or at all. However, we can easily update the modules.
Open the new Automation Account and click Modules. Here, you will find the modules that are installed by default and the last modified date. You can quickly update all of the currently installed Azure PowerShell modules by clicking the Update Azure Modules button. This process can take a little while, so Microsoft will ask if you are sure. Click Yes to continue.
The update process launches an Automation job. Click Jobs and expand the running instance of Update-AutomationAzureModulesForAccount. You can track the progress of this job by clicking Output.
Monitoring Progress of Azure PowerShell Modules Update in Azure Automation [Image Credit: Aidan Finn]
In the past, I have written PowerShell runbooks that require Azure PowerShell modules to be added to the default set. This has included AzureRM.Network for configuring network configurations during Azure Site Recovery failovers. You will know which modules are required, when you try to test that your runbook and cmdlets are identified as being unknown.
Do the following to add an Azure PowerShell module, open the Automation Account and browse to Modules Gallery. Search for the missing module and select it. Click the Import button and then click OK in the Import blade if you wish to continue. Note that some modules might identify other modules that must be imported before the desired one is imported.
It can take several minutes for an import to complete. You can track the progress of the import job by returning to Modules in the Automation Account and monitoring the status of the new module.
There are three pricing tiers for Azure Automation:
advertisment
A new Automation Account is deployed into the free tier. You can switch the tier to Basic if you require more than 500 minutes of runbook runtime or OMS if you purchase that bundle. To do this:
You now should be ready to use your Automation Account.
More from Aidan Finn
advertisment
Petri Newsletters
Whether it’s Security or Cloud Computing, we have the know-how for you. Sign up for our newsletters here.
advertisment
More in Microsoft Azure
Microsoft Revises Restrictive Cloud Licensing Policies to Avoid EU Antitrust Probe
May 19, 2022 | Rabia Noureen
Microsoft's Azure AD Conditional Access Service Can Now Require Reauthentication
May 13, 2022 | Rabia Noureen
Microsoft Addresses Cross-Tenant Database Vulnerability in Azure PostgreSQL
Apr 29, 2022 | Rabia Noureen
Microsoft Simplifies IT Monitoring with New Azure Managed Grafana Service
Apr 19, 2022 | Rabia Noureen
System Center 2022 is Now Available with New Datacenter Management Capabilities
Apr 4, 2022 | Rabia Noureen
Most popular on petri
Log in to save content to your profile.
Article saved!
Access saved content from your profile page. View Saved
Join The Conversation
Create a free account today to participate in forum conversations, comment on posts and more.
Copyright ©2019 BWW Media Group