A Step-by-Step Guide
Introduction:
Microsoft Azure is a major player in the ever-changing cloud computing market, providing a broad range of services. The ability to set up virtual computers and run different operating systems in the cloud is one of the core characteristics. This tutorial will provide you with a step-by-step walkthrough of how to set up a Linux Virtual Machine (VM) on Microsoft Azure, ensuring a smooth deployment.
Step 1: Accessing Azure Portal
First, go to portal.azure.com and log into the Azure Portal. If you don't already have one, follow the directions on the screen to create one.
Step 2: Navigate to Virtual Machines
Once logged in, navigate to the "Virtual Machines" section. This can be found on the left-hand side of the Azure Portal. Click on "Virtual Machines" to begin the VM deployment process.
Then click on Azure virtual machine. See image below**.**
Step 4: Basics Configuration
The below are the basic configuration steps with images
Look out for a name box that would appear and provide the new resource group. The name of the new resource group created is "DebugGRP".
Continue scrolling down to explore the 'Instance detail' section on the page. In this section, you can assign a name to your VM, designate a region for its residence, opt for a specific availability setting based on desired service availability and resilience, and specify the number of zones for VM replication, determining the level of application redundancy according to business needs. For the purpose of this tutorial, we will name our VM 'DebuglinuxVM,' choose '(Europe) UK South' as the VM region, select 'Availability Zone' as the availability option, and place the VM in Zone 1.
Proceed to the following section to specify the security level for your VM. In this instructional context, I will opt for the minimum security level, which is 'Standard.'
Select the operating system for your VM by clicking on the image box. For this deployment, we are choosing a Linux VM, specifically Ubuntu Server 20.04 LTS-x64 Gen2. Maintain the default settings for VM architecture and size, and then scroll down to the 'Administrative Account' section.
In the 'Administrative Account' section, you'll find two authentication methods for accessing the VM: SSH public key and Password. This segment is focused on demonstrating how to access a VM using an SSH public key.
Then scroll down to Username and create a unique username for the VM that you could always remember. Ensure that the SSH Public key source is "Generate new key". Give a unique key pair name you could always remember. For this learning, the VM username is "linuxuser" and the key pair name is "DebuglinuxVM_key".
At this stage of learning, we should have every other thing to default. Click on "Review and Create"
You will have to wait a little while for the page to display the caption "Validation passed" after selecting "Review + Create". This demonstrates the validity of the configuration from the beginning, so feel free to create.
Now click on "download private key and create resource"
Upon clicking on the blue download box, you wait for some seconds until you receive a notification that your deployment is complete. Then click on "go to resource"
Your virtual machine is ready when you see this page, and you need to connect to it.
You have now established a connection to your Linux virtual machine, which is up and running. You must now "SSH" into the virtual machine. At this time, pay close attention to the following few actions taken.
Click on "Select" and Switch to local machine OS.
For Mac and Linux system and Windows users, follow the steps on the screen.
To access the CLI environment on Azure, launch the Window Power Shell on your Windows PC and log in using Az.
Select the appropriate email address for your Azure portal on the new tab on your browser to get you logged in.
Once you reach the page displayed above, close the tab and return to PowerShell in your window. You will see what is seen in the screenshot below. indicating that you have successfully entered your system's CLI environment.
The next step is to go to the folder where it got downloaded on your system and check out the downloaded private key that ends in ".pem".
Right-click on the private key file and copy it as a path.
Copy the command path and run it on your Azure power shell.
Click on "enter" and type yes to continue.
NOTE: I changed the folder directory on the below image to "Downloads" during debugging. So whatever directory You decide to choose works fine.
You've managed to log into the Linux virtual machine via SSH.
Conclusion:
Congratulations! You've successfully set up a Linux Virtual Machine in Microsoft Azure. This guide provides a foundational understanding of the process, and from here, you can explore advanced configurations and optimize your VM for specific use cases. Azure's flexibility and scalability make it a powerful platform for hosting Linux-based applications and services.
Explore and leverage the various Azure services to enhance and extend the capabilities of your Linux VM as you continue your cloud journey.
Happy cloud computing!