How do you manage source control for your Automation Runbooks?

0
2
Asked By TechyNinja42 On

Hey everyone! I'm regularly working with some pretty complex automation scripts that need at least PowerShell 7.x and certain modules to run smoothly. I'm wondering how you all tackle source control for your Runbooks. I've been making updates manually, which is getting quite tedious since it feels like source control is locked into the built-in runtime environment (PowerShell 5.1). Has anyone found a way to automatically import Runbooks from Azure DevOps and run them in a specific custom runtime environment, or are you using a different approach altogether?

1 Answer

Answered By CodeWizard88 On

I created a PowerShell pipeline that takes care of everything needed, including building the ZIP files for modules before they get imported to Azure Automation. For the import process, I use Az.Automation, which has all the tools you need. When it comes to setting runtime environments, you might have to use the API directly until there's more support in Az.Automation for that. I also have a Runbook on GitHub which I made for managing modules with the API. It exposes a function to associate runbooks with runtime environments! Check it out here: https://github.com/mortenlerudjordet/Import-PSGalleryModuleAArte

ScriptGuru99 -

That sounds interesting! I'm more curious about how you're importing and updating Runbooks through the pipeline. Do you have any hands-on examples?

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.