Configuring HTTP enabled Virtual Machine under VPC over Azure Cloud Platform

Akshayanil
4 min readFeb 27, 2021

Log in or sign up in your Azure Cloud: https://portal.azure.com/

Use Student email ID to enjoy free credit of 100$

OR

Create a free tier account using Credit Card.

Let's start with the demo.

  1. Create a Resource Group.

2. Add resources

Add -> Compute -> Virtula Machine

Step1: BASICS

Set the password and user name

Setup the Security Groups

Licensing

This implies one can use the subscription of OS if one has and the particular charge will be reduced by the Cloud service provider.

Step 2: DISKS

Step 3:CREATING VIRTUAL NETWORK

Step 4:MANAGEMENT -gives the feature of auto-shutdown.

Step 5:ADVANCED- writing a script to set up the HTTP server

Step 6:TAGS

Step 7: Review and Create

Verification — Go to Resource

Go to os1: and do the ssh via Local computer, in my case I am using windows.

commands: ssh -l <username> <publicIP>

sudo su - : to log in as root.

rpm -q httpd: verify if httpd is installed.

vim /var/www/html/index.html : View and may edit the file to be displayed on http server.

lsblk: check the partitions created.

opening the server: http://publivIP:80/index.html

At first, it won't open: Two things needed to be done

  1. to add port 80 as inbound rules
  2. to add HTTP service in firewall

GO to the networking section of VIRTUAL MACHINE :-> Add inbound rules > service: http > port:80 > Allow > save

And, run the command:

firewall-cmd --add-service=http

firewall-cmd --list-service

now access the URL again…

Fantastic……..you did it…!

Similarly, you can launch another VM within the same subnet and setup for any other service.

Besides, there are three ways to use the Azure interface.

  1. Web GUI : as we performed above
  2. CLI : download the software https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-windows?tabs=azure-cli and follow the steps mentioned.
  3. API : Connect your smartphone to the VM on Cloud… will be discussed in future articles.

Also, many of us like to do things ad-hoc way, so there is an inbuilt option for Shell terminal

terminal symbol just after the search bar

And you are good to go..
I hope you find this article useful and get the idea of configuring VPC , subnets, and launching VM with HTTP service enabled.

Thank you for your time.

If u find this interesting, you can view my other projects at

and can connect to me on Linkedin:

https://www.linkedin.com/in/akshay-anil-26672a172/

--

--