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,

Author: Tom Janetscheck

Cloud Security Enthusiast | Security Advocate

Leave a Reply

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

You are commenting using your 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 )

Connecting to %s

%d bloggers like this: