How I Created and Connected to a Linux VM on Azure—A Friendly Step-by-Step Guide

Have you ever wondered how cloud servers actually work?
In this article, I’ll guide you through the process of creating a Linux Virtual Machine (VM) in Microsoft Azure, connecting to it, and understanding its significance in real-world cloud computing.
This guide is perfect for those new to Azure and eager for hands-on experience.
By following along, you'll enhance your cloud computing skills, boost your confidence in managing virtual environments, and gain practical knowledge to advance your career, improve technical expertise, or satisfy your curiosity about cloud technology.
Let’s dive in!
What Is a Virtual Machine (VM)?
A virtual machine is like a computer inside the cloud. It runs an operating system, like Windows or Linux, and you can use it just like a real server. Azure lets you create these with just a few clicks and configure them to run apps, websites, or tests without paying for physical hardware.
Azure offers Linux VMs (like Ubuntu) that you can deploy easily via the Azure Portal.
Now, let’s go through the steps.
Step 1: Sign in to the Azure Portal
Go to https://portal.azure.com
Sign in with your Microsoft Azure account (create one if you don’t have one yet — there’s a free tier you can use)
Once you’re in, you’ll see the Azure dashboard as your cloud control center.

Step 2: Create a New Virtual Machine
In the Azure Portal search bar, type Virtual Machines
Click Virtual Machines
Click + Create
Select Azure Virtual Machine


Step 3: Configure Basic VM Settings
On the Basics tab, fill in the following:
Project Details
Subscription: Free Trial (or your active subscription)
Resource Group:
Click Create new
Name it, example:
Linux-VM-RGClick OK
Instance Details
Virtual machine name:
linux-vmRegion: Choose a region close to you (e.g., West US)
Availability options: No infrastructure redundancy required
Image: Ubuntu Server 20.04 LTS
Size:
Select a free-tier friendly option like:
Standard_B1s(if available)


Set Administrator Account (Password Option)
Under the Authentication type, you have two options:
SSH Public Key
This is the more secure approach, and Azure can generate it for you automatically.
Password Authentication
If you choose a password instead, Azure will prompt you to enter a strong password. This is easier to remember but less secure than SSH keys — good for learning, but not best practice for production use.
Although the SSH public-key option is more secure than a password, in this article, I’ll be using password authentication
In the Administrator account section:
Authentication type: Password
Username:
azureuserPassword: Create a strong password
Must be at least 12 characters
Include uppercase, lowercase, numbers, and special characters
Configure Inbound Port Rules
Public inbound ports: Allow selected ports
Inbound ports: SSH (22)
This allows remote login using the password.

Step 4: Review and Deploy
Click Review + Create
Validation will pass
Click Create
Wait for the deployment to finish



STEP 5: Connect to the Linux Virtual Machine
After the deployment was completed, I selected Go to resource to open the virtual machine’s overview page.
From the top menu on the virtual machine overview page, I selected Connect. Azure presented two connection options:
Connect
Connect via Bastion
Selecting the Connect Option
I selected Connect rather than Connect via Bastion.
The Connect option allows access to the virtual machine using SSH from a local terminal, while Azure Bastion provides browser-based access through the Azure Portal. Since I was connecting from my local machine, I proceeded with the Connect option.

STEP 6: Connecting Using Command Prompt (Password Authentication)
After selecting Connect, Azure displayed the SSH connection details required to access the Linux virtual machine.
I copied the SSH command provided by Azure, which included the administrator username and the virtual machine’s public IP address..

After copying the SSH command,
I searched for the command prompt in the system (for Windows users)
Then run as administrator

I then opened Command Prompt on my device, pasted the command, and pressed Enter.
Command Prompt then prompted me to enter the administrator password configured during VM creation.
After entering the correct password, the SSH connection was established successfully, and I gained access to the Linux virtual machine.

This confirmed that the setup was complete, and I was ready to start using the VM for various tasks, such as deploying applications or running tests.
Conclusion
Creating and connecting to a Linux VM on Azure matters for real-world cloud computing because it provides a practical understanding of how cloud infrastructure operates. This experience is crucial for several reasons:
Scalability: It demonstrates how resources can be scaled up or down based on demand, which is a key advantage of cloud computing.
Cost-Efficiency: By using virtual machines, you can avoid the costs associated with maintaining physical hardware, paying only for the resources you use.
Flexibility: It allows you to deploy and test applications in a controlled environment, making it easier to develop and iterate on software projects.
Accessibility: Cloud-based VMs can be accessed from anywhere, facilitating remote work and collaboration.
Security: Understanding how to configure and secure VMs helps in protecting data and applications in the cloud.
Overall, this hands-on experience is essential for leveraging the full potential of cloud computing in various real-world applications.



