
Cloud
Learning Level
Azure Virtual Machines provide on-demand computing resources with the flexibility to choose operating system, runtime, and configuration.
By the end of this lesson, you'll understand:
# Create resource group
az group create --name myResourceGroup --location eastus
# Create VM
az vm create \
--resource-group myResourceGroup \
--name myVM \
--image UbuntuLTS \
--admin-username azureuser \
--generate-ssh-keys \
--size Standard_B2s \
--public-ip-sku Standard# Get public IP
az vm show --name myVM --resource-group myResourceGroup \
--query publicIps --output tsv
# SSH into VM
ssh azureuser@<public-ip># Create Windows VM
az vm create \
--resource-group myResourceGroup \
--name myWindowsVM \
--image Win2019Datacenter \
--admin-username azureuser \
--admin-password MyPassword123! \
--size Standard_B2s
# Get RDP file
az vm open-port --name myWindowsVM \
--resource-group myResourceGroup \
--port 3389# Start VM
az vm start --name myVM --resource-group myResourceGroup
# Stop VM
az vm stop --name myVM --resource-group myResourceGroup
# Deallocate VM (stop billing)
az vm deallocate --name myVM --resource-group myResourceGroup
# Delete VM
az vm delete --name myVM --resource-group myResourceGroup# List available sizes
az vm list-sizes --location eastus
# Resize VM (must be stopped first)
az vm deallocate --name myVM --resource-group myResourceGroup
az vm resize --resource-group myResourceGroup \
--name myVM \
--size Standard_B2s
az vm start --name myVM --resource-group myResourceGroup# Create data disk
az vm disk attach \
--resource-group myResourceGroup \
--vm-name myVM \
--name myDataDisk \
--size-gb 128
# List disks
az disk list --resource-group myResourceGroup
# Snapshot disk
az snapshot create \
--resource-group myResourceGroup \
--name mySnapshot \
--source myDataDiskLearn about App Service for managed web applications, or explore AKS for container orchestration.
Resources
Ojasa Mirai
Master AI-powered development skills through structured learning, real projects, and verified credentials. Whether you're upskilling your team or launching your career, we deliver the skills companies actually need.
Learn Deep • Build Real • Verify Skills • Launch Forward