Update the PowerShell Az Modules in the Azure Automation Accounts

Update the PowerShell Az Modules in the Azure Automation Accounts

Sometimes a scripted action or PowerShell script that works locally fails in Nerdio Manager with an error such as:

Sometimes the error message is different, or the error message suggests upgrading your PowerShell Az modules. These errors can often be resolved by upgrading the PowerShell Az module or modules used by the scripted action automation account. This topic guides you through how to update PowerShell Az modules in the Azure automation account.

To update the PowerShell Az module in the Azure automation account:

  1. In the Azure portal, navigate to Automation Accounts.

  2. Locate and select the scripted actions automation account.

  3. In the Shared Resources blade, select Modules.

  4. Select Browse gallery.

    Notes:

    • The relevant Az module is determined by the specific command that is failing. For example, if the script fails on Get-AzKeyVault, then it is the Az.KeyVault module that needs to be updated.

    • Sometimes the Az modules have dependencies on other Az modules, such as Az.Accounts. The dependencies may need to be updated as well.

    • If you use a hybrid worker to execute scripted actions, then the modules need to be updated on the hybrid worker VM, rather than in the automation account. This can be accomplished by selecting the Update Az Modules button on the hybrid worker VM.

  5. Select the module you want to update.

    The module details are displayed.

  6. Select Select.

  7. On the Add a module page, from the Runtime version drop-down list, select the desired version to install.

  8. Once you have made the desired selection, select Import.

  9. On the upper right, you may follow the progress of the import process in the Notifications section.

  10. Optionally, you may confirm the version import was successful by searching for the module.

Was this article helpful?

0 out of 0 found this helpful
Have more questions? Submit a request

Comments (0 comments)

Article is closed for comments.