DEV Community

Cover image for Create a virtual machine using Microsoft Azure
Tolulope Adeleke
Tolulope Adeleke

Posted on

Create a virtual machine using Microsoft Azure

As a beginner in Azure or Cloud computing in general, Creating a Virtual Machine(popularly called VM) is one of the fundamental knowledge you need to have.

In simple terms, a virtual machine is a program on a computer that works like it is a separate computer inside the main computer. It is a simple way to run more than one operating system on the same computer. A very powerful server can be split into several smaller virtual machines to use its resources better.

How do I create a virtual Machine?

I'm sure this is one of your top question as a beginner in this field, be rest assured it is as easy as it can be.

Now log into the Microsoft Azure portal, Look for Virtual machine on the Dashboard , click on it and then click create

Image description

I am going to take it step by step, at this point I will advice you practice along.

Subscription should be left at Default - Azure Subscription 1
(according to the diagram above)

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

Name the resource group- I will be naming mine "Webservers"

Next is Region , leave this at the default region recommended.

Next is Availability, set Availability as No Infrastructure redundancy required.

Next is Image, set this to Windows server 2019 Datacenter-Gen1

Next is Size, pick 'Standard_DS1_v2-1 vcpu,3.5Gib memory from the chart[note if you didn't see this, make use of the closest size in the standard section]

Then you set your Username and password [Make use of the username and password that will be accepted/ meets requirement and you can easily remember.
Now you have to select inbound Ports - Select the following;
HTTP(80) HTTPS(443) RDP(3389)

Next is licensing - Do Not Touch(STOP) we are not changing options here.

All done at this point guys...Click on Review + create

This is what your page should look like;

Image description
Image description
Then you click create.

Your deployment will be in progress( give it some minutes)
Image description

Image description

Once this is complete, you will get a page that will show you clearly that your "Deployment is complete"

Image description

Lets take this a Step further, YaaaY

Now it is time to click on the button "Go to Resource"

Next is to get On the top left, click Connect and select RDP.
To Connect with RDP:
IP address used Public IP address (20.106.149.142).
Port number is set to 3389.

Image description

Click on Download RDP file and open the file.

Enter the login credentials that you created within the Azure Portal (Your username and password that I advise to use if you can easily remember).Depending on your 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 on Add roles and features, make sure to follow the wizard and leave all the settings in the default settings, keep clicking next until you get to Server Roles.

Image description

Server Roles select Web Server (IIS) as shown in the diagram above. Select Include management tools (if applicable) then Click Add features.

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

Image description
Go to the main menu of your computer and search for Internet Information Services Manager(IIS)

Image description

Now you need to click on the > to the left of web01 (web01/iisadim) to open up the pane.

Image description

Make sure to click the arrow next to sites to access the default website.

Image description
Now right click on the default website.

Select Manage Website.
Select Advanced Settings.

Image description

Look for and copy the physical path which should be somethiing like *%SystemDrive%\inetpub\wwwroot.

Image description
Then Open File Explorer.
Go ahead to Enter this "%SystemDrive%\inetpub\wwwroot" physical path into the search bar at the top

You right ight click on the empty space and select Net Text Document and then open the text document.

Image description

Image description
Now enter the following text with no markup into the text document.
Welcome to my initial web page

Image description

Next, Click File and save as index.html, Make sure to Change the Save as type as All Files.
Then Click Save

Image description
This will take precedents over the iisstart file and you should now see this page as your home page when you go to the public IP address
When you go to the public IP address used earlier, you should see the home page you created with the text "Welcome to my initial web page" just like this;

Image description

That is all guys...Pretty straight forward right?

Image description

Well done if you have come this far... Great Job!

This is a hands on-experience on creating a VM and webserver on Azure.

See you on my next blog, guys!!!

Top comments (0)