How to create and deploy a Windows 11 Virtual Machine on Azure: A Step-by-Step Guide
Tags: azure, cloud, serverless, dataops
Published: 2024-05-30 11:06:33


Creating and connecting a virtual machine (VM) on Azure is a straightforward process when broken down into manageable steps. This comprehensive guide will take you through each step, ensuring you have all the information you need to get your VM up and running.

**Step 1: Create a Free Trial Account on Azure**
Begin by creating a free trial account on Azure. This account provides you with a subscription and $200 in Azure credits, which is more than enough to complete this tutorial and explore additional Azure services. Visit the Azure free trial page and follow the prompts to set up your account.

**Step 2: Log in to Your Azure Account**
Once your account is set up, navigate to the Azure portal at [portal.azure.com](url). Enter your login credentials, which include your username and password, to access the portal's dashboard. The Azure portal is the central hub where you can manage all your Azure resources and services.

**Step 3: Access the Virtual Machines Section**
In the Azure portal, locate the "Search resources, services, and docs" field at the top of the page. Type "virtual machines" into the search bar. 
You can also find the Virtual Machines option by clicking on the "hamburger" icon (three horizontal lines) in the top-left corner and scrolling through the menu, or by clicking on the "Create a resource" button and typing "virtual machine."


![Azure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lk8yodxuzcuxcxpv9fr7.png)





**Step 4: Select the Virtual Machine Option**
From the list of search results, click on the "Virtual Machines" option. This will take you to the Virtual Machines dashboard, where you can see any existing VMs and start the process of creating a new one.

![Azure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fis3jboott2eo38m55v3.png)

**Step 5: Click the “Create” Button**
To begin the creation process, click the “Create” button. There are two "Create" buttons available; choose the one labeled "Create a virtual machine hosted by Azure." This will open a new form where you can enter the details for your new VM.

![Azure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hek2es7i2222xfnoitwi.png)


**Step 6: Enter Project Details**
In the project details section, you will need to select your subscription and create a resource group. 
A resource group is a logical container that holds related resources for an Azure solution. Click on the "Create new" button to set up a new resource group, and give it a meaningful name that will help you identify it later.

![Azure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ciuk2kneq57yozt9msvv.png)



**Step 7: Configure Virtual Machine Settings**
Next, you will need to provide details about the VM you are creating. This includes:

**Name**: Give your VM a unique and descriptive name.
**Region**: Choose the Azure region closest to your location to ensure optimal performance.
**Image**: Select the operating system for your VM. Common options include Ubuntu Server 20.04 LTS and Windows Server 2019 Datacenter.
**Size**: Choose the size of your VM based on your needs. The size determines the VM's CPU, memory, and storage capacity.



![Azure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i73k0c8pb4f1nq62mmkx.png)






**Step 8: Create an Administrator Account**
Set up an administrator account for your VM. You will need to choose an authentication type (password or SSH key). For simplicity, select "Password." Enter a username, such as "AzureUser," and a strong password. This account will be used to access and manage your VM.

![Azure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sf5n9gg0pz6jgsrmka8x.png)


**Step 9: Configure Inbound Port Rules**
To allow remote access to your VM, configure the inbound port rules. If you are creating a Linux VM, select SSH (port 22). For a Windows VM, select RDP (port 3389) and HTTP (Port 80). This configuration allows you to connect to your VM from your local machine.



![Azure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ee4rk9cl2ec11favffqa.png)





**Step 10: Review Licensing**
Ensure that you have checked the licensing terms and conditions. By default, this box is unchecked. Click the box to acknowledge and accept the licensing terms for the chosen operating system.

![Azure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/an6zdpmz8djlpu6l2y86.png)



**Step 11: Disable Boot Diagnostics**
In the "Monitoring" tab, locate the boot diagnostics option and click "Disable." This step is optional but can simplify the setup process for basic VM configurations.

![Azure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zvluwe8qv3vj2st921wk.png)



**Step 12: Review and Create**
Click the "Review + Create" button. Azure will validate your configuration. If validation passes, click "Create" to start the deployment. If there are any issues, address the recommendations and try again. The deployment process typically takes 3-5 minutes.

![Azure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ct5h5vb7gni3wriejed.png)


**(Optional)** An important option to consider is the use of tags, which are crucial for organizing billing data. Tags can be utilized to group usage by cost center, especially if you are running multiple VMs for different organizations. Additionally, you can use tags to categorize costs by runtime environment, such as identifying the billing usage for VMs running in the production environment. Here, I will name the tag.


![Azure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/td0stkm8kgd2mlnql0n9.png)





**Step 13: Verify VM Status**
Once the deployment is complete, navigate to the Virtual Machines dashboard and check the status of your VM. If the VM status is "Running," the deployment was successful.



![Azure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r0rs5vbpd1yws4oq9814.png)




![Azure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i2cazttn6q00c6zqmuzj.png)





**Step 14: Connect to Your Virtual Machine**
First, it's advisable to click on the public IP address and adjust the Idle timeout to the max (30 minutes), save after this step and close.

To connect to your VM, click on the "Connect" button in the VM blade within the Azure portal. For Windows VMs, choose "RDP" and for Linux VMs, choose "SSH."


![Azure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xppqg7ay7pjnx5tuvge4.png)

![Azure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w3152jzrsrbc7k21hnx7.png)


![Azure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9sybwg6kfgov7kcp50fm.png)















**Step 15: Download the Connection File**
Wait for the Public IP to be configured, once validated and configured for a Windows VM, click "Download RDP File."  Open the downloaded RDP file on your local computer and click "Connect."

For a Linux VM, follow the provided SSH connection instructions.

![Azure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o1y994666jqgfibtexpt.png)


![Azure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6wv9rj997s69apusq0lt.png)







**Step 16: Enter Administrator Credentials**
When prompted, enter the administrator username and password that you created during the VM setup process. Click "OK" or "Connect" to proceed.


![Azure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xjpnmnglneipr0npz50o.png)



**Step 17: Complete the Connection**
Follow any additional prompts to complete the connection. You may need to accept a certificate warning. Click "Yes" or "Continue" as needed.



![Azure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kb1lj1vp2lyk0t4eeh4g.png)





**Step 18: Start Using Your Virtual Machine**
Once connected, you can begin using your VM as needed. For a Windows VM, you will have a full desktop environment. For a Linux VM, you will have terminal access.



![Azure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uce6gbffzik9ywgezxtm.png)





By following these steps, you can efficiently create and connect to a virtual machine on Azure, leveraging the power and flexibility of Azure's cloud infrastructure.