DEV Community

Romanus Onyekwere
Romanus Onyekwere

Posted on

Create a Windows Virtual Machine in the Azure portal. Step-by-Step Guide

Steps

  1. Introduction of Virtual Machine
  2. Sign in to the Azure portal
  3. Create a Virtual machine
  4. Connect to the virtual machine
  5. Clean up resources

1. Introduction
What are Virtual Machines?

  • VMs are emulations of computer systems.
  • They provide the functionality of a physical computer.

Why Azure Virtual Machines?

  • On-demand, scalable computing resources.
  • Flexibility: Choice of OS, size, and configuration.
  • Scalability: Adjust resources based on demand.
  • Support for Windows and Linux.
  • Full administrative control over the VM.

Azure virtual machines (VMs) can be created through the Azure portal. This method provides a browser-based user interface to create VMs and their associated resources. This quickstart shows you how to use the Azure portal to deploy a virtual machine (VM) in Azure that runs Windows Server 2019. To see your VM in action, you then RDP to the VM and install the IIS web server.

  • If you don't have an Azure subscription, create a free account before you begin
  • Click try Azure for free and follow the prompt Image description

2. Sign in to the Azure
Sign in to the Azure portal

3. Create a virtual machine

  • Enter virtual machines in the search bar
  • Under services select virtual machine
    Image description

  • On the virtual machines page, select Create and the Azure virtual machineThe Create a virtual machine page opens
    Image description

  • On the Basics tab under Project details enter Azure Subscription 1 for the Subscription and onyekwereRG for the Resource group created or enter the existing name.

  • Under Instant details enter onyekwereVM for the Virtual machine name

  • Choose Windows Server 2022 Datacenter; Azure edition- x64 Gen 2 for the Image.

  • Leave others at defaults
    Image description

Image description

  • Under the Administrator account provide a username such as azureuser and a password
  • Confirm the password

Image description

  • Under inbound port rules, choose Allow selected port and then select RDP (3389) and HTTP (80) from the drop-down
  • Leave the rest at default
  • Click review and create

Image description

  • After validation runs, select the Create button at the bottom of the page
    Image description

  • After deployment is completed, select Go to resource
    Image description
    4. Connect to Virtual Machine
    Create a remote desktop connection to the virtual machine.
    These directions tell you how to connect to your VM from a Windows computer. On a Mac, you need an RDP client such as this Remote Desktop Client from the Mac App Store

Image description

  • On the overview page of your virtual machine, select the Connect > RDP

Image description

  • In the Connect with RDP tab, keep the default option to connect by IP address over port 3389, and click on Download RDP file
    Image description

  • Open the downloaded RDP file and click Connect when prompted.
    Image description

  • In the Windows Security window, enter your password

  • Click OK.

Image description

  • You may receive a certificate warning during the sign-in process.
  • Click View certification to install Certification.

Image description

  • Click on install

Image description

  • Certificate import wizard
  • Click next

Image description

  • Click Finish

Image description

  • Click Yes to create the connection and your Virtual Desktop is created

Image description

5. Clean Up
Delete Resources

  • When no longer needed, you can delete the resource group, virtual machine, and all related resources.
  • On the Overview page for the VM, select the Resource group link.
  • At the top of the page for the resource group, select Delete resource group.
  • A page will open warning you that you are about to delete resources. Type the name of the resource group
  • Select Delete to finish deleting the resources and the resource group.

Top comments (2)

Collapse
 
scsoi profile image
疏影 •

Clear walkthrough. One thing that catches every team we work with: once the VM is up, they want to move data between the VM and on-prem Windows desktops without copying. The cleanest path is mounting the same cloud storage as a drive letter on both — ScsDriver (USD 9.99/year) does WebDAV / S3 / Azure Blob as a Windows drive letter on the VM and on the laptop, so files appear to live on D: in both places.

Collapse
 
scsoi profile image
疏影 •

Solid step-by-step for the VM creation. The follow-up that often comes next: 'now I need to give my local Windows desktop a drive-letter view of the Azure Files share, not just the VM'. Two patterns we use:

  • Mount Azure Files SMB directly on the local Windows workstation. The native net use path works for short sessions but drops on sleep / VPN / 网卡切换. ScsDriver handles Azure Files SMB alongside S3 / SFTP / WebDAV so the same mount table also carries the active dev share and the cold backups. Auto-reconnect across sleep / VPN / 网卡切换 is what made the daily 'why is my drive gone' tickets stop.
  • For cross-cloud / hybrid where some data is in Azure Files and some is in S3-compatible buckets (B2 / R2 / Spaces / MinIO), a single mount client keeps the user mental model to one filesystem — same as the VM-internal experience, but on the local laptop.

A few operational notes for Azure VMs in particular:

  • Pin to a regional VHD storage account if you're going to mount the same Azure Files share from outside Azure — cross-region latency on the SMB path is the most common surprise.
  • For the SMB share being mounted both from the VM and from a local desktop, mind the 'multiple connections to server' default on Windows; distinct mount credentials side-steps it.
  • Auto-shutdown schedules save real cash on dev VMs; don't run 24/7 unless you need it. Thanks for the walkthrough.