How to create a Windows virtual machine in the Azure portal and connect to it through RDP.
Published: 2023-06-12 16:53:41

**STEP 1**
**Sign into the Azure portal:** 
Go to the Azure portal at portal.azure.com and sign into your Azure account. If you do not have any, then create one.

**STEP 2** 
**Create a new virtual machine:**
Go to the search box on top of the page and type **virtual machine**. Select the virtual machine from the options that appear. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j7t93gvwd8wxqfq033zz.PNG)

Click on create and select **Azure virtual machine**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h7jh00gojoxz6ulqmpi5.PNG)

**STEP 3** 
**Configure the virtual machine settings:**
Under the **Basics** tab, specify the following details:

- 
Subscription: Choose the appropriate subscription.

- 
Resource group: Create a new resource group or select an existing one.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r8mymkg4tshw7e3hqr6f.PNG)

- 
Virtual machine name: Provide a name for your virtual machine.

- 
Region: Choose the region closest to your location.

- 
Image: Select the desired Windows Server version.

- 
Size: Choose an appropriate size for your VM based on your requirements.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/at7ly96a37jy09p1ohwu.PNG)

Under the **Administrator account** section, provide a username and password for the administrator account. This will be used to log in to the VM.

Under the **Inbound port rules** check **allow selected ports** button and select RDP (3389).

Under **Licensing** check the box.

Leave the remaining settings as default or modify them as per your requirements.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iidarvlhzikgo0d1cqs2.PNG)

**STEP 4**
 **Configure networking**
Under the **Networking** tab, select the appropriate virtual network and subnet for your VM or leave it at default.
Leave the other settings as default or modify them as needed.

Then click on review  + create button.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ycqo1xi0scp6ajnkkdp.PNG)

**STEP 5 **
**Review and create:**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0uhwy8rrizc45yd9arp5.PNG)

Review the summary of your VM configuration and click on the "Create" button to start the deployment process.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wat07yx5rlpmk0bq9kr0.PNG)

Still in progress, creating **dependencies**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/35zcr7uynkxgsdz3bt84.PNG)

**Deployment is complete, click on go to resource.**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5rgk3cosmf4fwq7v06iv.PNG)

**Virtual machine overview**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/irgarovrkklflhzy8bdf.PNG)

**STEP 7** 
**Connect to the virtual machine using RDP:**
Once the virtual machine is deployed, you can connect to it using Remote Desktop Protocol (RDP).

Go to the Azure portal and navigate to your VM.
Click on the "Connect" button at the top of the VM overview page.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m5y14lfy7wpzi9y5dah7.PNG)

In the "Connect" blade, select "RDP" as the connection method,
and when prompted, enter the username and password you provided while creating the virtual machine.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/779n0jfoh10u0r9mozzz.PNG)

**This may pop-up, click yes to connect.**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rlknqpc4jyow49lnpywx.PNG)

Your virtual desktop will be visible for use at this point.

With this, you have now created a Windows virtual machine in Azure and connected to it using RDP. You can now use the remote desktop session to manage and configure your VM.

**STEP 8**
**Delete the resource**
It is advised you delete the resource and its dependencies if you are not making us of it for cost optimization.

The best way to achieve this is to delete the **resource group** you created. 

Go to the VM, click on **resources group** and when it opens, click on **delete resource group** button.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yh74cpo9us540smy18jg.PNG)

Copy the resource group name and paste it in the box to confirm deletion. Then click on the delete button. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iy0mj1r9g9z0wulltkot.PNG)

With this, the Virtual Machine you created all the dependencies will be deleted.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j7rktepzo8zuv8e91sld.PNG)