Resize your ARM VMs via PowerShell

Howdy folks,

I have several VMs running in my Azure demo environment. As resizing them is a common task for me and doing it in Azure portal can be really anoying, I usually use a PowerShell one-liner that manages it all for me. With the following code you can resize all VMs in the same Resource Group to the same size.

$NewVMSize = Standard_A1_v2 ## All VMs will be resized to Standard A1_V2
Get-AzureRmVM -ResourceGroupName myRG | foreach {$_.HardwareProfile.VmSize = $NewVMSize; Update-AzureRmVM -ResourceGroupName myRG -VM $_}

By for now,
Tom

Author: Thomas Janetscheck

Architect for Microsoft Cloud and Messaging Solutions, community leader, Azure and PowerShell enthusiast working for Data One GmbH

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