Azure Virtual Machines

Azure Virtual Machines (VMs) provide on-demand, scalable computing resources with the flexibility of virtualization. Use VMs for development, testing, hosting applications, and extending your data center to the cloud.

VM Sizes

Select from a broad range of VM sizes that are optimized for different workloads.

SeriesPurposeTypical CPUs / RAM
A-seriesGeneral purpose1‑8 vCPU / 2‑56 GB
D-seriesCompute‑optimized2‑64 vCPU / 8‑256 GB
E-seriesMemory‑optimized2‑64 vCPU / 16‑432 GB
F-seriesHigh‑CPU2‑72 vCPU / 4‑144 GB
G-seriesStorage‑optimized4‑32 vCPU / 28‑864 GB

Operating System Images

Choose from a catalog of supported OS images, including Windows Server, Ubuntu, Red Hat, and custom images.

az vm create \
    --resource-group MyResourceGroup \
    --name MyVM \
    --image UbuntuLTS \
    --admin-username azureuser \
    --generate-ssh-keys

Creating a Virtual Machine

Use the Azure portal, Azure CLI, or ARM templates. Below is a quick Azure CLI walkthrough.

  1. Log in: az login
  2. Select subscription: az account set --subscription "SUB_ID"
  3. Create resource group: az group create -n MyRG -l eastus
  4. Deploy VM (example):
    az vm create \
        --resource-group MyRG \
        --name WebServer01 \
        --image Win2019Datacenter \
        --size Standard_B2s \
        --admin-username azureadmin \
        --admin-password Password123! \
        --authentication-type password
  5. Open port 80: az vm open-port --resource-group MyRG --name WebServer01 --port 80

Managing Virtual Machines

Azure provides tools for monitoring, scaling, and automating VM lifecycle.

  • Azure Monitor: Collect metrics and logs.
  • Auto‑scale: Adjust VM count based on demand.
  • Azure Automation: Runbooks for start/stop schedules.

Security & Networking

Secure your VMs with Azure Security Center, Network Security Groups (NSG), and Azure Bastion.

  • Enable Azure Disk Encryption.
  • Use Managed Identities for Azure resources.
  • Configure NSG rules to restrict inbound traffic.

Pricing

Pay for VMs per second with the ability to reserve instances for up to 3 years at a discount.

VM SizePay‑as‑you‑go (USD/hr)1‑yr Reserved (USD/hr)
Standard_B2s0.0460.028
Standard_D2s_v30.0960.062
Standard_E2s_v30.1210.080

Use the Azure Pricing Calculator to estimate costs.

Frequently Asked Questions

Can I migrate on‑premises VMs to Azure?
Yes, using Azure Migrate or Azure Site Recovery.
What is the difference between Spot VMs and regular VMs?
Spot VMs use unused Azure capacity at a discounted rate but can be evicted when needed.
How do I backup a VM?
Enable Azure Backup or use snapshots for point‑in‑time recovery.