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.
Series | Purpose | Typical CPUs / RAM |
---|---|---|
A-series | General purpose | 1‑8 vCPU / 2‑56 GB |
D-series | Compute‑optimized | 2‑64 vCPU / 8‑256 GB |
E-series | Memory‑optimized | 2‑64 vCPU / 16‑432 GB |
F-series | High‑CPU | 2‑72 vCPU / 4‑144 GB |
G-series | Storage‑optimized | 4‑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.
- Log in:
az login
- Select subscription:
az account set --subscription "SUB_ID"
- Create resource group:
az group create -n MyRG -l eastus
- 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
- 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 Size | Pay‑as‑you‑go (USD/hr) | 1‑yr Reserved (USD/hr) |
---|---|---|
Standard_B2s | 0.046 | 0.028 |
Standard_D2s_v3 | 0.096 | 0.062 |
Standard_E2s_v3 | 0.121 | 0.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.