Azure CLI 2 · Resource groups and VMs
Create a Linux VM
Create a VM with SSH keys generated for you.
az vm create --resource-group my-rg --name my-vm --image Ubuntu2204 --admin-username azureuser --generate-ssh-keys
Official Azure CLI 2 documentation
More resource groups and vms commands
- Create a resource group
- List resource groups
- Delete a resource group
- List VMs and their IPs
- Stop and deallocate a VM
- Start a VM
All resource groups and vms commands · Azure CLI 2 cheatsheet