How to create a Virtual Machine using Microsoft Azure
Tags: cloudcomputing, azure, tutorial
Published: 2022-01-27 11:53:33

As someone who is just starting out in Azure or Cloud computing, learning how to create a Virtual Machine(popularly known as VM) is one of the fundamental skills or knowledge that should be in your arsenal.
In layman terms, a virtual machine is a program that runs on a computer which behaves like a separate computer inside the main desktop computer. It is an easy way of running more than one operating systems on the same computer. A very powerful server can be split into several smaller virtual machines for better use of its resources.

**How do I go about creating a Virtual machine?**

As a beginner, you may think this is a herculean task; however I can assure you that it is easier than you imagine.
First, you create an Azure account: https://azure.microsoft.com/en-us/free/
Once created, look for Virtual machines on the dashboard(2nd icon from the right), click on it and then click create.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eihspgw664fgz12472jm.PNG)
Follow me as I walk you through the step by step process. Get on your system and follow through.

Subscription should be left at Default - **Azure subscription 1**
(See image above for reference)

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

Create a new resource group, click **"Create new"**.

Name the resource group- I will be using **"VMserver"**

Next is **Region** , leave this as the default region recommended(depending on your region, its best you choose somewhere close to your region)

Go to **Availability options**, set as **No Infrastructure redundancy required.**

Move on to **Image**, set as **Windows server 2019 Datacenter-Gen2**

Next is **Size**, choose **Standard_DS1_v2-1 vcpu,3.5GiB memory**(please note if you didn't see this, make use of the closest size in the standard section)

Then you set your Username and password (Ensure the username and password that meets the requirement and it is something that can be easily remembered).

Now move have to select inbound Ports - Select the following;
**HTTP(80) HTTPS(443) RDP(3389)**
Next is licensing – **check the box here**.
Click on **Review + create**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pqeob41joxjczbedf3qj.png)
Then you click **Create.**

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

Your deployment will be in progress( give it time).

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d6ki1b3r1jhw78vpcdyg.PNG)
Once this is completed, you will see a notification page that will show your **"Your deployment is complete"**

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

**You made it this far, Yippe… Sip Coffee**

Click on the **"Go to Resource"** button

Next is click **Connect and select RDP**.
To **connect with RDP**:
IP address: use Public IP address (102.37.116.142).
Port number: 3389

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/myyb5a3al9j9pbjg6s8g.PNG)
**Click on Download RDP file and open the file, then connect.**

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

Enter the login details initially created within the Azure Portal (Username and password).Depending on the network you may need to click on other account and enter \iisadmin as the username and the password you setup.

**Click connect and yes to accept the certificate**


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vh1qd9oen2bp67enpgj3.jpg)
**Now Login and Server Manager should be open**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x0w0l8zofy6yo0kbg6oh.PNG)
Next is to Click the **Add roles and features**, ensure to follow the default settings, keep clicking next until Server Roles.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8dm1ukc8h5i65lgcn68n.PNG)
**Server Roles **, select Web Server (IIS) as shown in the diagram below. Select Include management tools (if applicable) then Click **Add features**

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pgk696mt5bflzjubvipf.PNG)
Click **Next >**
The minimal features should already be selected and adequate.
Click **Next >**
Scroll down, select IIS Management Console in Management Tools, then click **Next >**.
Select **Restart** the destination server automatically if required, then click **Install**. Once the installation has completed, click **Close**.


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

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

Go to the search box of your computer and search for **Internet Information Services Manager(IIS)**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v3smqyjk95h000qwvkdl.PNG)
Click on the > to the top left of **opevm (opevm/iisadim)** to open up the options pane.
Make sure to click the arrow next to **Sites **to access the default website.

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

Click the drop down for **Sites**.
Click **Manage website.**
Click **Advanced settings.**
Look for the physical path which should be this **%SystemDrive%\inetpub\wwwroot.
**
Then go ahead to Open **File Explorer**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x2t7vlseoj5khxes8bjv.PNG)
Click on the **Windows(C:)**
Search for **"ineptub" folder** and click to open

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5t6ywpg94riplknbmv9w.PNG)
Click on the **wwwroot folder** to open it.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t3ezstc6168vpqq2zped.PNG)
**Right click **on the empty space and select **New Text Document** and proceed to open the **Text document**.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5xey9ivtl53wurm196lp.PNG)
Enter the following text into text document.
**Welcome to my initial web page**
Click File and save as **index.html**. (Ensure to change the Save as type as **All Files)**.
Click **Save**
Open a **browser** and enter the public IP address: (102.37.116.142), then search

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dz8lejp2nqbeu3be5vbn.PNG)
**Yaay..You have done it.**

Now, that’s how you create a VM and Webserver on Azure.

**Till you read my next post..Cheers!!!!**