Prerequisites
- An Azure account — sign up free here
- Access to the Azure Portal at portal.azure.com
- A Resource Group to deploy into (create one first if needed)
Create VM via Azure Portal
Navigate to the Azure Portal and follow these steps:
- In the search bar, type Virtual Machines and click it
- Click + Create → Azure virtual machine
- The "Create a virtual machine" wizard opens with multiple tabs
Basics Tab — Explained
The Basics tab is where you configure the core identity and compute settings of your VM.
Subscription & Resource Group
Select your subscription and the Resource Group where the VM will live. Create a new Resource Group if needed — name it something like rg-windows-vm-demo.
Virtual Machine Name
Choose a meaningful name. Azure VM names have rules:
- 1–15 characters for Windows VMs
- Letters, numbers, and hyphens only
- Cannot start or end with a hyphen
- Must be unique within the Resource Group
vm-[purpose]-[env]-[number]Example:
vm-webserver-prod-01 or vm-sqldb-dev-01
Region
Choose the region closest to your users. For Indian workloads, use Central India (Pune). Remember — not all VM sizes are available in all regions.
Availability Options
This determines your redundancy level:
| Option | SLA | Use For |
|---|---|---|
| No infrastructure redundancy | 99.9% (Premium SSD) | Dev/test, single-instance apps |
| Availability Zone | 99.99% | Production — zone-level protection |
| Availability Set | 99.95% | Legacy approach — use zones instead |
| Virtual Machine Scale Set | 99.99% | Auto-scaling applications |
Security Type
Leave as Trusted launch virtual machines for most workloads. This enables Secure Boot and vTPM for enhanced security.
Image
The operating system image. For Windows, common choices:
- Windows Server 2022 Datacenter — Latest, recommended for new workloads
- Windows Server 2019 Datacenter — Stable, widely used
- Windows 11 Pro — Desktop OS for developer workstations
- Windows 10 Pro — Desktop OS (older)
Size
Click See all sizes to browse all available VM sizes for your region. For this tutorial, use Standard_B2s (2 vCPUs, 4 GB RAM) — cheap and sufficient for learning.
Administrator Account
Create a local administrator account for the VM:
- Username — Cannot be "admin", "administrator", "root", "guest", or "test"
- Password — Minimum 12 characters, must include uppercase, lowercase, number, and special character
Inbound Port Rules
For Windows VMs you need RDP (port 3389) to connect. Select:
- Public inbound ports: Allow selected ports
- Select inbound ports: RDP (3389)
Disks Tab — Explained
OS Disk Type
Choose the storage type for your OS disk:
| Disk Type | Performance | Cost | Use For |
|---|---|---|---|
| Premium SSD | High IOPS, low latency | Higher | Production workloads — also needed for 99.9% SLA |
| Standard SSD | Moderate IOPS | Medium | Dev/test, light production |
| Standard HDD | Low IOPS | Lowest | Backups, archives — no SLA |
Delete OS disk when VM is deleted
Check this box! By default, the OS disk is NOT deleted when you delete the VM. Ticking this saves you from orphaned disk charges.
Networking Tab — Explained
Virtual Network
Azure will create a new VNet automatically if you don't have one. For a tutorial VM, the default is fine. Name it something like vnet-demo.
Subnet
A subnet within the VNet. Default subnet (10.0.0.0/24) is fine for this tutorial.
Public IP
Required if you want to connect to the VM from the internet. A new Standard SKU public IP is created automatically. Note: public IPs are billed even when the VM is stopped.
NIC Network Security Group
The firewall for your VM. Select Basic for this tutorial — it will configure RDP access based on your earlier port selection. For production, use Advanced to create custom rules.
Delete NIC when VM is deleted
Check this box — same reason as OS disk. Prevents orphaned NIC charges.
Management Tab — Key Settings
Auto-shutdown
Enable auto-shutdown with a time (e.g., 8 PM daily). This is extremely useful for dev/test VMs — it automatically deallocates the VM every evening, saving cost.
Azure Monitor agent
Install this to collect performance metrics and logs. Recommended for production VMs — leave it enabled.
Review + Create
Click Review + create. Azure validates your configuration — if anything is wrong, it highlights the issue and which tab to fix it on. Once validation passes, you see a summary with the estimated monthly cost. Click Create to deploy.
Deployment typically takes 2–5 minutes. You'll see a notification in the portal when complete.
Create via Azure CLI
The entire VM creation can be done in one CLI command:
# Create resource group first
az group create \
--name rg-windows-vm-demo \
--location centralindia
# Create the Windows VM
az vm create \
--resource-group rg-windows-vm-demo \
--name vm-windows-demo \
--image Win2022Datacenter \
--size Standard_B2s \
--admin-username azureuser \
--admin-password "YourSecureP@ssword123!" \
--location centralindia \
--public-ip-sku Standard
# Open RDP port 3389
az vm open-port \
--resource-group rg-windows-vm-demo \
--name vm-windows-demo \
--port 3389
az vm show \
--resource-group rg-windows-vm-demo \
--name vm-windows-demo \
--show-details \
--query publicIps \
--output tsv
After the VM is Created
Once deployed, connect to your VM via RDP:
- In the Azure Portal, go to your VM → click Connect → RDP
- Download the .rdp file
- Open the .rdp file — Windows Remote Desktop opens
- Enter your administrator username and password
- Accept the certificate warning and connect
You're now inside a Windows Server running in Azure's data centre in Pune!
Cleaning Up
To avoid ongoing charges, clean up when done:
az group delete \
--name rg-windows-vm-demo \
--yes \
--no-wait