When a workload needs more CPU, memory, or storage, you can resize an Azure virtual machine to a different size. This process scales the VM up to a larger, more powerful size or down to a smaller, less expensive one. The key tradeoff is disruption: if the new size is not available on the same physical hardware cluster that hosts the VM, the VM must be deallocated (stopped and released from its host) before the change. Deallocation causes a restart and a brief outage, so it matters for stateful applications that cannot easily stop. When you deallocate a VM, the operating system and data disks are preserved, but any dynamic public or private IP address assigned to the VM is released, which could break connections that rely on a fixed address.
You can resize a VM through several tools, each following the same basic lifecycle. In the Azure Portal, you navigate to the virtual machine, select a new size, and apply the change; the portal handles the deallocation automatically if needed. With PowerShell, you first run Get-AzVMSize to list the sizes available on the VM's current hardware, then use Update-AzVM to apply the new size. If the desired size is not listed, you must deallocate the VM with Stop-AzVM before resizing. Using the Azure CLI, you check available sizes with az vm list-vm-resize-options, deallocate with az vm deallocate, resize, and then restart the VM. Across all methods, the critical decision point is whether the new size requires a different hardware cluster: if yes, the VM goes through the stopped (deallocated) state and loses its dynamic IP, but keeps its disks and any static IP you assigned.
VM scale sets are groups of identical VMs that work together to handle changes in demand. They keep the application available and cost-efficient by automatically adding or removing instances. Three components make this work:
A scale set depends on the load balancer to distribute requests and on the health probe to detect failure. When demand rises, autoscale adds a new VM. The VM starts in a provisioning state while it is created, then moves to a running state. The load balancer only directs traffic to the VM after the health probe confirms it is healthy. When demand falls, autoscale removes the running instances that have the fewest active connections, following an orderly scale-in policy.
When multiple VMs are grouped in an availability set to protect against hardware failure, you must coordinate the resize operation. First, check if the new size is available on the current hardware using Get-AzVMSize. If it is not available, you must deallocate all VMs in the set at the same time using Stop-AzVM because the entire availability set lives on the same hardware cluster. After they are deallocated, apply the new size to every VM with Update-AzVM, then restart them all with Start-AzVM. This approach prevents a situation where one VM has been resized to a new hardware cluster while another is still on the old cluster, breaking the availability guarantees of the set.
A process flow showing how to resize VMs in an availability set, starting with checking available sizes and branching based on whether the desired size is on the current hardware cluster or requires deallocation of all VMs.
Eager to master hybrid server management? Discover how to administer Windows Server Hybrid Core Infrastructure on Azure, setting your path towards the Microsoft Certified: Azure Hybrid Infrastructure Administrator Associate certification!
Prepare and test your skills

Prepare and test your skills

When an Azure virtual machine is deallocated during a resize, its operating system and data disks are preserved, but any dynamic public or private IP addresses are released. Any static IP addresses assigned to the VM are kept, though deallocation causes a restart and a brief outage.
You must deallocate all virtual machines in the availability set at the same time using Stop-AzVM because the entire set must reside on the same hardware cluster. After deallocation, apply the new size to every VM with Update-AzVM and then restart all of them with Start-AzVM to maintain availability guarantees.
Virtual machine scale sets use autoscale rules, load balancing, and health probes to manage instances. Autoscale rules trigger the addition or removal of instances based on conditions like CPU thresholds, load balancing spreads incoming traffic, and health probes verify instance responsiveness before the load balancer sends traffic.