Developments in Digital
Developments in Digital

Update AzureRm Module on Azure DevOps

When using the Azure PowerShell task in Azure DevOps pipelines and the AzureRm module, the latest version available is currently 6.7.0.

If you wish to use newer versions, then you'll need to run a PowerShell script to upgrade the AzureRM module version.

Create a standard PowerShell task (not Azure), and execute the following script:

$azureModuleVersion = "6.13.1"

Install-PackageProvider -Name NuGet -Force -Scope CurrentUser

Get-Module -Name '*AzureRM*' -ListAvailable | Select-Object Name, Version

Get-Module -Name '*AzureRM*' -ListAvailable | Remove-Module -Force

Install-Module -Name AzureRM -RequiredVersion $azureModuleVersion -Force -Scope CurrentUser -AllowClobber

Import-Module AzureRM -RequiredVersion $azureModuleVersion -Force -Verbose -Scope Local

Get-Module -Name '*AzureRM*' -ListAvailable | Select-Object Name, Version

This will need to be executed before your Azure PowerShell task, but the specified version of AzureRM should now be available.