Deploy a Windows Server Virtual Machine

Lab overview

The network is ready, so Surf City Boats can deploy its first cloud server. In this lab you create vm-surfcity-01, a Windows Server 2022 Datacenter: Azure Edition virtual machine, in rg-surfcity-infra and East US 2. You choose the D2as_v6 size, set the local administrator account, close every public inbound port, put the OS on Standard SSD, attach a 32 GiB Standard HDD data disk, and connect the VM to snet-servers with no public IP and no NIC-level security group. After deployment you confirm the VM is running on a private 10.10.1.x address with the data disk at LUN 0.

Why you'd do this

A virtual machine is the most direct way to run a server workload in Azure: a full Windows operating system you control, which is why it's the first thing most administrators deploy and the first thing AZ-104 asks about. The Create VM wizard looks like a long form, but it's a handful of decisions you'll make on every server, and this lab makes each one deliberately.

The decision that defines this project is Public IP: None and Public inbound ports: None. The wizard's default is to hand a new VM a public address and open RDP to the internet, and that default is why exposed port 3389 is one of the most attacked things in any cloud. You'll give the server only a private address on snet-servers; lab 5 adds Azure Bastion as the way in, and lab 4 adds the subnet-level security group. Leaving the NIC network security group at None here is intentional too, because stacking an NSG on the NIC and another on the subnet is a common source of "why can't I connect" tickets.

The image and size are worth a second look. Windows Server 2022 Datacenter: Azure Edition is the build that supports Azure-only features like hotpatching, and Gen2 gives you UEFI boot. D2as_v6 is a 2-vCPU general-purpose AMD size; the lowercase s means it supports premium storage even though you'll choose cheaper tiers. Keeping Security type at Standard rather than Trusted launch keeps the lab simple, though Trusted launch is the right default for new production builds.

On Disks, the OS disk goes on Standard SSD and the data disk on Standard HDD. Separating data from the OS disk is standard practice so you can resize, snapshot, or detach the data independently, and the HDD tier shows that disk SKUs are a per-disk choice. The two cleanup checkboxes, Delete with VM and Delete public IP and NIC when VM is deleted, prevent the orphaned disks and NICs that keep billing after a server is gone. Check the Review + create page carefully: subnet, disk type, and public IP are the three things that are painful to change after deployment.

Lab details

  • Virtual machine: vm-surfcity-01 in rg-surfcity-infra · Region: (US) East US 2
  • Image: Windows Server 2022 Datacenter: Azure Edition - x64 Gen2 · Size: D2as_v6
  • Availability: No infrastructure redundancy required · Security type: Standard
  • Local admin: surfadmin / P@ssw0rd!123 · Public inbound ports: None
  • OS disk: Standard SSD (LRS) · Data disk: vm-surfcity-01-data, Standard HDD (LRS), 32 GiB (S4), LUN 0
  • Networking: vnet-surfcity / snet-servers · Public IP: None · NIC NSG: None · Load balancing: None

Learning objectives

  1. Deploy a Windows Server 2022 Azure Edition VM from the Azure portal.
  2. Select an availability option, security type, image, and VM size.
  3. Deploy a VM with no public IP address and no public inbound ports.
  4. Choose OS disk and data disk types and attach a new empty data disk.
  5. Connect a VM to an existing virtual network and subnet.
  6. Verify a VM's private IP, network attachment, and attached disks after deployment.

Exam relevance

  • AZ-900 — Microsoft Azure Fundamentals — virtual machines, VM sizes and images, managed disks, public versus private IP addresses.
  • AZ-104 — Microsoft Azure Administrator — create and configure VMs, configure VM networking and disks, availability options, Azure Edition images.

Where this lab fits in the project

Lab 1 created rg-surfcity-infra and lab 2 built vnet-surfcity with the snet-servers subnet; this lab puts the first server on that subnet. The VM is deliberately unreachable from the internet when you finish: lab 4 secures the subnet with nsg-surfcity-servers, lab 5 deploys Azure Bastion so you can open a desktop session to it from the browser, and lab 6 mounts the Surf City file share on it as the Z: drive.

The surfadmin credentials you set here are the ones you'll use to sign in through Bastion in labs 5 and 6.

Step-by-step instructions

  1. Open the Virtual machines service:
    • On the Azure portal Home page, in the search box at the top, type Virtual machines and select it under Services.
    • Select + Create, then Azure virtual machine.
  2. Configure project and instance details:
    • Confirm the Surf City Boats subscription is selected and choose resource group rg-surfcity-infra.
    • In the Virtual machine name field, type vm-surfcity-01 and select region (US) East US 2.
    • In the Availability options dropdown, select No infrastructure redundancy required, and confirm Security type is Standard.
    • In the Image dropdown, select Windows Server 2022 Datacenter: Azure Edition - x64 Gen2 and confirm VM architecture is x64.
    • Next to Size, select See all sizes, select D2as_v6, then select Select.
  3. Configure the administrator account:
    • Username: surfadmin
    • Password and Confirm password: P@ssw0rd!123
  4. Configure inbound port rules:
    • Under Public inbound ports, select None.
    • Select Next: Disks.
  5. Configure the OS disk and add a data disk:
    • In the OS disk type dropdown, select Standard SSD (locally-redundant storage) and confirm Delete with VM is checked.
    • Under Data disks, select Create and attach a new disk.
    • Name the disk vm-surfcity-01-data and confirm Source type is None (empty disk).
    • Next to Size, select Change size, choose Disk SKU Standard HDD (locally-redundant storage), select 32 GiB (S4), and select OK.
    • Select OK to attach the disk and confirm it appears at LUN 0, then select Next: Networking.
  6. Configure networking:
    • Confirm Virtual network shows vnet-surfcity and Subnet shows snet-servers (10.10.1.0/24).
    • In the Public IP dropdown, select None.
    • Under NIC network security group, select None.
    • Confirm Delete public IP and NIC when VM is deleted is checked.
    • Under Load balancing, review the options and confirm None is selected, then select Review + create.
  7. Create the virtual machine:
    • Confirm Validation passed is displayed.
    • Confirm the Image, Size, Virtual network, and Subnet are listed correctly, the OS disk type shows Standard SSD, one data disk is listed, and Public IP and Public inbound ports both show None.
    • Select Create.
  8. Verify the virtual machine:
    • When deployment completes, select Go to resource.
    • On the Overview page, confirm Status shows Running, the Private IP address is in the 10.10.1.x range, and the Public IP address field is blank.
    • Under Networking, select Network settings and confirm the network interface is attached to vnet-surfcity/snet-servers with no network security group listed on it.
    • Under Settings, select Disks and confirm vm-surfcity-01-data is listed under Data disks at LUN 0.

Launch the lab simulation — free with a labITpro account; no Azure subscription required.

An Introduction to Microsoft Entra ID

Learn what you need to know to get started with Microsoft Entra ID with this easily-digestible 5-hour bootcamp from best-selling instructor, Thomas Mitchell.

Disable these ads by becoming a labITpro Supporter!

Azure vNets Explained

Want to learn about Azure virtual networks? In this quick-hitting explanation, you’ll learn what they are, what they do, and you’ll learn about key Azure vNet features.

Disable these ads by becoming a labITpro Supporter!