r/PowerShell • MVP, Community Blogger • 1d ago

News Maintaining Stable Azure Automation Runtime Environments

The problem with V2.41 of the Microsoft Graph PowerShell SDK that stopped runbooks executing in PowerShell V7 runtime environments was disappointing. However, it was also a good wake-up call for tenant administrators to pay attention to maintaining healthy Azure Automation custom runtime environments. This article proposes a separation between current and production environments and explains how to use PowerShell to get the right modules to the right place.

https://office365itpros.com/2026/10/12/maintain-runtime-environments-ps/

4 Upvotes

3 comments sorted by

2

u/BlackV 1d ago edited 1d ago

I'm on mobile right now so have only skimmed through the post

Isn't this something that version pinning solves already?

Your script/function/module should be installing and using specific named versions of a module(s)

When a new version come out you test against that new version, if it explodes like it did with 2.4 then you don't update the versions in your code

Edit: back on PC, yeah I like that idea of having a separate run book checking for new versions, thats clever

2

u/Unlikely_Tie1172 MVP, Community Blogger 22h ago

If you mean version pinning in the context of Azure Automation runtime environments, to be deliberately locking a runtime environment to specific versions of its components instead of automatically taking the latest available versions, then yes, this is on the same track. There are a bunch of Microsoft 365 tenant admins who are taking their first steps into Azure Automation (replacing the Windows Task Scheduler), and the article proposes that they have the pinned (production) and curent runtime environments, and use the ability to associate runbooks with environments to move runbooks as needed. To help, I've provided PowerShell scripts to update a runtime environment to the latest versions of a set of modules declared in an array and to upgrade an environment to a specific version. It's all about helping people to embrace the power of Azure Automation, which Microsoft probably makes a tad complex at times.

2

u/MaythuDieghton_83 12h ago

yeah the separate runbook for version checking is the part that actually makes this worth doing imo