We have a number of build and release pipelines in Azure DevOps which have been running fine for ages and then recently (last week of August 2020) they started getting the below error:

The ‘Get-AzLogicApp’ command was not found in the module Az.LogicApp

I was using the Az powershell modules to deploy some integration account artefacts and my good friend Pedro Almeida also started getting the same error on his builds too. The awesome thing at work these days is our team is remote and split across Canada, the UK and Portugal so Pedro and I jumped on a Microsoft Teams call to troubleshoot this together when we noticed we had the same problem.

Quite quickly we realised it was something to do with the versions of Powershell cmdlets installed. We have a task in the pipeline which uses the below powershell to install and setup all of the Az cmdlets for us:

Install-Module -Name Az -AllowClobber -Force
Install-Module -Name Az.Accounts -AllowClobber -Force
Uninstall-AzureRM

Get-installedModule | select Name

The snippet installs the Az modules and we usually for troubleshooting make it display any modules installed as we have had other things like this happen in the past. When troubleshooting we realised that there was an update to Az.Accounts recently and version 1.9.3 was installed by default. It seems like the Az.LogicApps cmdlets need Az.Accounts version 1.9.2 and we tried forcing the version back to the older v1.9.2 of Az.Accounts and this fixes the issue.

Install-Module -Name Az -AllowClobber -Force
Install-Module -Name Az.Accounts -AllowClobber -Force -RequiredVersion 1.9.2
Uninstall-AzureRM

Get-installedModule | select Name

Not sure if there might be a better way to solve this problem ongoing, seems like some dependency version challenges to be had here, but this fixed our problem for now and hoping it might help someone else out of a jam.

 

Buy Me A Coffee