For system, network and cloud administrators

How to resize an existing Azure virtual machine using Azure CLI

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


How to view available Azure predefined virtual machine sizes using Azure CLI

Depending on the purpose of your Azure virtual machine, you’ll need to choose a size for it when you’re creating it. Plus, the availability of Azure resources depends on the region you’ll want to use them. You can list available Azure predefined virtual machine sizes by using:

az vm list-sizes --location westeurope -o table

How to list available Azure virtual machine images using Azure CLI

For example, if you need to view all available virtual machine images published by Microsoft, you can use:

az vm image list --publisher Microsoft -o table


How to list Azure virtual machines using Azure CLI

In order to view what Azure virtual machines are existing within your subscription or, in this case, a particular resource group, you can use:

az vm list --resource-group YourResourceGroup -o table


How to create an Azure virtual machine using Azure CLI

In order to create an Azure virtual machine, let’s say Ubuntu, you can use:

az vm create --name YourVMName --resource-group YourResourceGroup --admin-username myuser --image UbuntuLTS --public-ip-sku Standard --generate-ssh-keys --verbose


Follow BusyNetwork