Azure Automation – Running scripts locally on VM through runbooks

för 3 år sedan

I was tasked to create a powershell script to run on a schedule on a Azure VM. Normally this would be running as a scheduled task on the VM but seeing as we're working with AzureVM and schedule tasks are legacy I wanted to explore the possibilities of running the schedule and script in Azure to keep the VM clean and the configuration scalable. After some research the best option would be running the powershell script as a CustomScriptExtension on the VM, and the schedule would be handled by a Process Automation Runbook (using Automation Accounts). What I ended up with is the script below. It's fairly easy to configure and contains almost all the required configuration in the parameters. Read More