For system, network and cloud administrators
In order to resize your Azure virtual machine, you’ll first need to check the available resizing options:
az vm list-vm-resize-options --resource-group YourResourceGroup --name YourVMName -o table
Afterwards, the virtual machine can be resized (to Standard_D2s_v3, for example) using:
az vm resize --resource-group YourResourceGroup --name YourVMName --size Standard_D2s_v3