Creating a Linux Virtual Machine Seamlessly in Azure

Firstly, why do you need a virtual machine? As exciting as creating a virtual machine might be , it is important to understand the reasons for creating a virtual machine. Here are few reasons:

  1. Cost Savings: Virtual machines can help businesses save money. Instead of buying lots of physical computers/servers, a business can use one powerful computer and create many virtual machines on it. This means less resources is spent buying and maintaining several physical machines.

  2. Flexibility: Virtual machines make work a lot more flexible. Businesses can easily create, change, or delete virtual machines based on their needs. It's like having a different computer to serve different purposes.

  3. Scalability: Virtual machines can grow with the business. If a business needs more computers, they can easily create more virtual machines. It's like adding more seats to a table when more guests arrive.

To summarize, having virtual machines is like having a magical tool that helps businesses save money, work flexibly, increase work efficiency at a defined speed, and do many many other things at once without necessarily using multiple physical devices.

Prerequisites for getting started

With Microsoft Azure, starting a virtual machine or any other Azure Service has been made seamless. You basically need 2 things to get started.

  1. An email (Any email will do e.g. gmail, yahoomail, aol, Microsoft etc.)

  2. A credit card, debit card to get you through the sign up process. Click here to signup on Azure.

Upon signing up ,you'll need to validate your account.

For a first time Azure user, you'll be given a $200 credit or you can simply opt for a pay as you use subscription.

Note: Before you are able to use the Azure services, you'll need to have an active subscription, then you're ready to get started.

Steps in creating an Azure Virtual Machine of your choice

Step 1: Sign in to Azure Portal

  1. Open your web browser and go to the Azure Portal.

  2. Sign in with your Azure account (use your email and password).

Step 2: Skip this step and proceed to Step 3 if you have a Resource Group else continue to create one.

Type Resource groups in the search bar and select resource group.

Next, click create.

Following the guidelines below, select a subscription. (upon setting your account, you'll setup a subscription service".

Name your Resource group. For the purpose of this tutorial I named mine "RedCounty".

Pick a region. I used (US) East US.

Finally, click "Review + Create"

You should get "Validation Passed" notification, provided you have an active subscription. Next, click Create.

Your Resource group is created and displayed as shown below. Now we can proceed to create our Virtual Machine.

Step 3: Navigate to Virtual Machines

  1. In the Azure Portal Search bar, type "virtual machine" and click virtual machine.

  2. Click Create and select "Azure Virtual Machine" from the dropdown as seen in the image below.

  3. 7 configuration tabs are displayed after clicking create "Azure Virtual machine " . Proceed with the Basics

    The first configuration is the "Project Details". Select your subscription and the Resource group of choice. My Resource group is Red County.

    Note: All starred(*) fields are compulsory.

  4. Next, Select your subscription from the dropdown. Name your Virtual Machine. I've named mine "BusinessIntel".

    You may select the other options depending on your preference, or simply follow the selected options below to get you started.

    Next, Select a VM size to support the workload that you want to run. Afterwards, Select SSH public key as the Authentication type. Next Create a username and password which will be used in accessing the Virtual Machine remotely. My username is "Busintel".

    Note: copy and paste your username on a notepad

  5. For the inbound port rule section, select "Allow selected ports" then select SSH from the list of inbound ports then click Next.

Step 4: Configure Disks Configure the Disk settings, including OS disk type and size.

  1. For the OS Disk Size, i proceeded with the default

  2. OS Disk Type. Premium is recommended, please use premium, for the purpose of this blog, I selected "Standard SSD locally-redundant storage).

  3. Ensure you check the Delete with VM check box.

Note: for the remaining configurations like Networking, Management, Monitoring, Advanced, Tags go with the default settings. You may however Proceed with configuring each of the aforementioned services if you have your preference, else click on Review + Create.

  1. Next, you should get the notification below showing "Validation Passed". Scroll down to see an overview of your configuration. If you're happy with your setup, click Create to proceed to deploy your virtual machine.

  2. This only takes few minutes to deploy.

Next, the prompt below appears. Click the Download Private key and create resource.

After few seconds, you get the status below showing you that your deployment is complete. Click on "Go to resource" to proceed.

Note: Copy and paste your Public ip on a notepad

Step 6 : Connecting to Your virtual Machine

  1. Open your downloads folder or any default folder your private key downloaded to.

  2. Right click on the your private key( this is the file with the .pem extension) and open with Microsoft edge or any browser of choice. Next copy the file path in the browser URL and paste on a notepad.

  3. Launch Windows PowerShell

  4. Once the PowerShell opens up, type the following code. Note that the Username is case sensitive. Refer to the information you copied into notepad and form a string as show below.

    Once you type the above command paste it into PowerShell, then press the enter key on your keyboard. Next, you should have something similar to the image below.

    Once the above is displayed, type "yes".

  5. Immediately uou get the view below, indicating that you've successfully connected to your Virtual Machine.