DEV Community

Cover image for How to create a Virtual Machine using Microsoft Azure
Opeyemi Jokanola
Opeyemi Jokanola

Posted on

How to create a Virtual Machine using Microsoft Azure

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
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

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
Then you click Create.

Image description

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

Image description
Once this is completed, you will see a notification page that will show your "Your deployment is complete"

Image description

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
Click on Download RDP file and open the file, then connect.

Image description

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
Now Login and Server Manager should be open

Image description
Next is to Click the Add roles and features, ensure to follow the default settings, keep clicking next until Server Roles.

Image description
Server Roles **, select Web Server (IIS) as shown in the diagram below. Select Include management tools (if applicable) then Click **Add features

Image description

Image description
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

Image description

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

Image description
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

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
Click on the Windows(C:)
Search for "ineptub" folder and click to open

Image description
Click on the wwwroot folder to open it.

Image description
Right click **on the empty space and select **New Text Document and proceed to open the Text document.

Image description
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
Yaay..You have done it.

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

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

Top comments (0)