Hands-On Lab on Creating the Azure VM (Linux (ubuntu 20.04)
There are 3 primary steps in creating the Azure VM (Linux (ubuntu 20.04).
- Create virtual machine in the Azure Portal + Configurations
- Test the Connection
- Install Web Server & View the Web Server in Action
1. Create virtual machine in the Azure Portal + Configurations
Go to your Azure Portal. Now, on your left-hand side, click “Virtual Machines”. If this is your first time creating VMs, then you will not see any instances running. Proceed “Create Virtual Machine”.
For “Project Details”, make sure the correct subscription is selected.
In administrator account, provide the admin username for the VM and Generate an SSH public key.
Make sure you select HTTP for web access
Then, I will leave the rest of the configurations by default. Proceed “Review + Create”. Wait until the deployment is successful.
Note: Make sure it passes Validation
Download the PEM Key.
Congratulations!!! You just created a Virtual Machine
2. Test the Connection
Step 2: Specify the location of the PEM file on the
ssh -i azureuser@xxxxxx.pem
Open your PowerShell and paste the path and enter, select yes on the prompt
Once in the VM.
3. Install Web Server & View the Web Server in Action
Install Web Server & View the Web Server in Action
Type the following in the PowerShell
The first command is checking for any Ubuntu updates.
Update Ubuntu server
sudo apt update
The second command is installing Apache with the “-y” option to skip required “Yes” prompts during the installation.
Install Apache Server
sudo apt -y install apache2
After running both commands, go over to the Azure Portal and copy out the Public IP
Note: if for some reasons you can't access the Azure Portal immediately, Type in the following commands to get the IP Address
This command is to find the public IP address you’ll want to input into your browser to verify that the installation has gone correctly. This is what the webpage should look like:
Find current IP address
curl https://ipinfo.io/ip
Now your type the IP on the browser and enter.
If you got the above image, congratulations, you just installed a Linux VM and also installed a Web Server.
Did you succeed or still have issues?
Comment Below!
Top comments (0)