Sequentially Start & Stop Azure VMs

You can see the Azure automation version of sequentially starting & stopping Azure VMs on my other post.

Have you ever wanted to sequentially start and stop your Azure Virtual Machines all in one hit? Not just Azure VMs, you can use this same method for any sequential job you want to run in Azure.

The following script will start and stop your Azure VMs in parallel by using background jobs in PowerShell. Please note, this script is based on Azure Resource Manager, however with easy change to the code, this same structure will still work with Azure Service Management.

Also note that this script won’t work if you’re logging onto Azure with a Microsoft account. In this instance, you would need to go into the Azure AD directory and create a user in the Azure AD organisation directory in which is linked to your Azure subscription. Make this user a (co-administrator or contributor) of Azure and use this account with the below PowerShell script.

Azure PowerShell

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: