Creating a Virtual Machine in Azure: A Step-by-Step Guide for Beginners
Tags: azure, beginners, devops, cloud
Published: 2023-03-25 15:37:09

Do you want to create a virtual machine (VM) in Azure but are unsure of where to begin? Fear not, we will walk you through a quick and simple step so you can follow along. 

The digital equivalent of a physical computer is known as a virtual machine (VM). In essence, a virtual machine is a computer that runs on another computer. This virtual machine can be configured to run a variety of operating systems, software, and configurations.

So, how do you create a virtual machine in Azure? Here are the steps to take:

## Step 1: Sign up / log in to Azure 

If you haven't signed up for an Azure account yet, you can easily create one using this [link](https://azure.microsoft.com/en-gb/free/) follow the steps on the website and log in to the Azure portal.

## Step 2: Create a new Virtual machine 

Click on Virtual Machine (VM) from the home page of the portal. 


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

If you can't find it on the portal's home page, type virtual machine into the search box. Select Virtual machine from the Azure services menu.

Click on Create and select Azure virtual machine from the drop down menu

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

This will lead you to a configuration screen for your virtual machine

We have the option to create a new resource group by clicking on Create new. 

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

We will give our resource group a name called marchload.

At this stage, you can give your VM a name and we will call our VM henriettavm. You can select your preferred Region and Availability zone from the drop down menu.


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

## Step 3: Choose your operating system

Under instance details, select your operating system from the Image drop down menu. Azure provides a wide range of operating systems, including multiple versions of Windows and Linux. 
We will be selecting Windows Server 2019 Datacenter - x64 Gen 2 as shown in the image below. 

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

## Step 4: Choose your VM size

Enter the size of your virtual machine from the Size option. This will be determined by your requirements, such as the amount of RAM and CPU power required.


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

## Step 5: Create a username and password

Under the Administrator account section, create a username and password. This will be used to log in to your virtual machine.

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

Under inbound port rule choose Allow selected ports and select HTTP (80) and RDP (3389) from the drop down menu.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/71628jwycra3vb2zzy4k.png)

After you've finished all of the steps, click on the Review + Create button at the bottom of the page.  You will see a message saying Validation passed. 

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

After the validation passes, go through your settings and change the monitoring and select Disable (you can also keep the default setting under monitoring)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4wj9xgy8b5gmw4ihx7ek.png)

Click the "Create" button


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

Azure will then begin the process of constructing your virtual machine, which could take a few minutes


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

After deployment has been completed, click on Go to resource

You have now successfully created a virtual computer on Azure! 

To connect to the VM, click on Connect and then the RDP option on the overview page of Virtual Machine.

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

Download the RDP file 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9igkcdqf0c3rmikdfl4g.png)

Open the downloaded RDP file and click Connect when prompted

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9onhppatn87cdor1ue2o.png)

Input your credentials you created under the Administrator account section

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

Congratulations you have created your first Virtual Machine!

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

You may now use it for whatever reason you require!