Skip to main content

Creating a Windows Virtual Machine in Microsoft Azure

Hands-On Lab


Photo of Michael Heydt

Michael Heydt

Azure Training Architect II in Content





In this learning activity, we will create a Windows Server 2016 Datacenter virtual machine in Azure using the Azure portal, which provides a web-based interface that you can use to interactively create and manage VMs and other Azure resources. After completing this learning activity, you will have learned how to create and run a VM using the Azure portal and how to configure a VM for remote access.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Creating a Windows Virtual Machine in Microsoft Azure

Our company's cloud infrastructure team has created an Azure environment to host virtual machines for the remote workers to use. This environment consists of a resource group and a single virtual network (with one default subnet) that is connected to the internet. Remote users connect to the Virtual Machines (VMs) on this subnet via RDP. Our manager has asked us to create a new Windows Server 2016 Datacenter virtual machine in this environment, and ensure that the remote workers can reach it with Remote Desktop from the internet.

We can utilize any tools we like in order to complete the lab (Azure portal, Cloud Shell, PowerShell, etc.) though for this guide we will be using the Azure portal.

Before we begin, we need to log in using the credentials provided by the lab. The Virtual Network LabVNET has already been provided for us as well as a Resource Group.

Create the Windows Virtual Machine

Once we're logged in to the Azure Portal, let's start by selecting Virtual machines from the left-hand menu. In here, select the Add button. On the right-hand side of the screen, there's a menu across the top. In Basics, we've got a web form to fill out:

  • Subscription: LA_PAYGO_PRODLABS1
  • Resource group: Use the existing one
  • Virtual machine name: labVM
  • Region: South Central US
  • Availability options: No infrastructure redundancy required
  • Image: Windows Server 2016 Datacenter
  • Size: Standard B1ms
    • This requires us to click Change size. In the resulting popout window, we'll highlight our choice and then click the Select button.
  • Username: LAStudent
  • Password: L1nuxAcad3my
  • Confirm Password: L1nuxAcad3my
  • Public inbound ports: Allow selected ports
  • Select inbound ports: RDP

Over in Disks (in the top menu, next to Basic), click the arrow next to ADVANCED, and make sure Use managed disks is set to Yes. We can leave everything else here alone.

In Networking we're greeted with another web form, but we don't need to touch anything here. The defaults that Azure sets for us are fine.

We need to get into Management, and make sure Boot Diagnostics is set to Off.

We can leave Advanced and Tags alone, so just click on the Review + create button at the bottom of the screen.

Once we get a Validation Passed message, click Create at the bottom, and sit back for a bit while the VM deploys. Eventually, we'll see it get a green check mark, meaning that it's up and running. We can click on the labVM name to go to it.

In the labVM's page, there's a menu to the left. Click Networking in the Settings section. Here we will see our RDP security group.

Finally, select the Resources groups from the navigation bar. Select our resource group (it will be the only one present). The page shows our five resources:

  • Virtual machine
  • Network interface
  • Public IP address
  • Network security group
  • Virtual network

Remote into the Virtual Machine

To remote into our VM, select labVM from the resources we just reviewed. Here, select Connect from the top of the page.

We can fire up our RPD client manually, or we can choose Download RDP and launch the client by clicking on that downloaded .rdp file.

Once we enter a username and password, and click through certification prompts if we get any, we'll connect to our Windows VM as the user LAStudent. As soon as the desktop appears, we will know that we have set up everything correctly.


Congratulations! We have not only created a new Windows Virtual Machine, but we also were able to log in to it remotely as well!