Quickstart: Create a Windows Virtual Machine in Azure
This guide will walk you through the steps to create a basic Windows Virtual Machine (VM) in Azure using the Azure portal. Virtual machines are on-demand, scalable computing resources that you can use like a physical computer.
Tip: You can create Azure VMs using the Azure portal, Azure CLI, Azure PowerShell, or Azure Resource Manager (ARM) templates. This quickstart focuses on the portal for ease of use.
Prerequisites
Before you begin, you need an Azure subscription. If you don't have one, you can create a free account.
Step 1: Sign in to the Azure portal
Sign In
- Open your web browser and go to the Azure portal.
- Sign in with your Azure account credentials.
Step 2: Create a Virtual Machine
Initiate VM Creation
From the Azure portal home page, select Create a resource.
Figure 1: Azure portal home page with "Create a resource" highlighted.
Select Virtual Machine
- In the Search services and marketplace bar, type Virtual machine and select it from the results.
- Click Create.
Configure Basics
On the Create a virtual machine page, under the Basics tab, do the following:
- Subscription: Select your Azure subscription.
- Resource group: Select Create new and enter a name for your resource group (e.g., myResourceGroup). A resource group is a logical container for your Azure resources.
- Virtual machine name: Enter a name for your virtual machine (e.g., myVM).
- Region: Select a region close to you or your users (e.g., East US).
- Availability options: For this quickstart, select No infrastructure redundancy required.
- Security type: Leave as Standard.
- Image: Select Windows Server 2022 Datacenter: Azure Edition - Gen2 or another Windows Server image of your choice.
- VM architecture: Leave as x64.
- Size: Select a VM size. For testing, Standard_B2s is a cost-effective option.
- Administrator account:
- Username: Enter an administrator username (e.g., azureuser).
- Password: Enter a password and confirm it. Ensure the password meets the complexity requirements.
- Inbound port rules: Under Public inbound ports, select Allow selected ports. Then, for Select inbound ports, choose RDP (3389). This allows you to connect to your VM using Remote Desktop.
Figure 2: Basic configuration for a new Azure VM.
Configure Disks
Under the Disks tab, you can configure storage. For this quickstart, the default settings are fine. You can choose different OS disk types (e.g., Premium SSD, Standard SSD, Standard HDD) based on your performance and cost needs.
Configure Networking
Under the Networking tab, you can configure virtual networks, subnets, and public IP addresses. For this quickstart, the defaults are acceptable. A new virtual network, subnet, and public IP address will be created.
Note: Ensure that RDP (port 3389) is allowed in the network security group (NSG) that will be created. This is typically handled by the inbound port rules selected in the Basics tab.
Review and Create
- Click on the Review + create tab.
- Azure will validate your configuration. If validation passes, review the summary of your VM settings.
- Click Create.
The deployment of your VM will take a few minutes. You can monitor the deployment progress in the portal.
Step 3: Connect to the Virtual Machine
Get Public IP Address
Once the deployment is complete, navigate to your virtual machine resource in the Azure portal.
On the Overview page, find the Public IP address and copy it.
Figure 3: VM Overview page displaying the Public IP address.
Connect via RDP
- Open your Remote Desktop Connection client on your local computer.
- In the Computer field, paste the public IP address of your VM.
- Click Connect.
- You may see a warning about the identity of the remote computer. Click Yes to continue.
- When prompted for credentials, click More choices, then Use a different account.
- Enter the username and password you created in Step 2 (e.g., azureuser and your password).
- Click OK.
You should now be connected to your Windows virtual machine in Azure.
Step 4: Clean up resources
When you are finished with your virtual machine, you can delete the resource group to remove the VM and all associated resources.
Delete Resource Group
- In the Azure portal, navigate to Resource groups.
- Select the resource group you created (e.g., myResourceGroup).
- Click Delete resource group.
- Confirm the deletion by typing the resource group name and clicking Delete.
Next Steps
You have successfully created and connected to a Windows VM in Azure. Consider exploring other Azure services or learning how to:
Explore More Tutorials