If your Run Books in Azure Automation rely on any of the new versions of the AzureRM PowerShell module, then they may start to fail! That’s because all the modules that get pre-added in Azure Automation point to an older version of AzureRM modules… Follow the steps in this post to fix failing module upgrade…

The screen shot below shows you the Module pane in AzureAutomation, you could click the update azure modules button to auto upgrade the modules. This functionality allows you to force an upgrade of the modules, this would update the modules to a version that are compatible with each other. However, this functionality seems to be broken…

AzureAutomation-UpdateAzureModules

Error Message

AzureAutomation-UpdateModule-ErrorMessage

Fix

After hours of troubleshooting, it came to light that the AzureRm.Profile and AzureRM.Automation should point to the same version, if they are on separate versions then Azure Automation silently starts to fail the module upgrade process. This can however be fixed by deleting the AzureRM.Profile module from the modules list and then forcing the upgrade of the modules.

AzureAutomation-AzureRMProfileModuleDelete

This will download the AzureRM.Profile module to the correct version that matches the version of AzureRM.Automation and then continuous to perform the upgrade of all the modules successfully.

The fix is simple, but just putting this out there because it took hours to figure the root cause…

Tarun

Related Posts

About Tarun Arora

Tarun Arora is obsessed with high-quality working software, DevOps, Continuous Delivery and Agile. His core strengths are Azure, VSTS, PowerShell, SQL and WPF. He is a Microsoft MVP in Visual Studio Development Tools and the author of 'DevOps & ALM with TFS 2015'.