In 2017 Microsoft revealed that 40% of Azure virtual machines (VM) were Linux-based. Next, it was revealed in an interview for ZDNet last year that about half of Azure VMs are Linux. With this increasing Linux popularity both on in-house servers and in the cloud, it was only a matter of time until Linux was leading in Azure cloud. In this article, I’ll explain why Linux is the most popular system on Azure cloud, what your backup and restore options are, and how you can create a Linux Virtual Machine in Azure.
Recommended Read: Easy way to install AWS CLI on Linux
Linux Becomes the Most-Used Operating System on Azure Cloud
The rising use of Linux in Microsoft Azure has turned it into the most used Operating System (OS) on this cloud platform. Far from treating Linux as a competitor, Microsoft is showing support for the open-source operating system by ensuring that all instances running on Azure support Linux Virtual Machines (VM).
What is the reason for this widespread popularity of Linux in Azure? Simply put, while Windows OS leads the market for personal computing, Linux is the most popular operating system in enterprise computing. Even though Microsoft offers a Windows Server operating system geared for enterprise use, at the end of the day, Linux is leading with 68% of the market.
Thus, Microsoft is attracting more Linux developers to its Azure platform by providing more services for Linux user, recognizing open-source code as something beneficial for every developer. Now we’ve established the case for Linux in Azure, the first stage before building a Virtual Machine in Azure is to choose a backup and restore option.
While it is a cloud-based backup solution, you can also use Azure Backup on-premises. It is simple to configure and use, combining consistent backups for Windows and Linux VMs with security features and management controls via the Azure portal.
It works by creating recovery points stored in geo-redundant recovery vaults, allowing you to restore the whole VM or just specific files. To learn how to backup Azure Virtual Machines for Linux, check out this simple tutorial.
There are some considerations to take into account when using Azure backup, including assessing your requirements and choosing the price scheme that best fits your organization. You can learn more about it in this article.
Azure Site Recovery
This option allows you to protect your VMs from a disaster, by using VM replication to an Azure region of your choice, thus allowing for a fast recovery. This allows you to configure site recovery integrated with Azure automation runbooks. That means that you can run disaster-recovery drills without stopping your production workloads.
A managed snapshot is basically a copy of a managed disk on a moment in time. Since they exist independently of the source disk, you can use them to create new disks and rebuild a VM. They are billed by the used portion of the disk.
How to Create Linux Virtual Machine in Microsoft Azure
Step #1: Generate the SSH keys.
As opposed to AWS, where you need to create “KeyPairs” in order to connect to the VMs, to create a Linux Virtual Machine in Microsoft Azure, you need to generate these SSH keys manually. For example, you can execute the following commands with default filenames, making sure you generate these files in a .ssh directory under user’s home.
$ cd ~/.ssh
$ ssh-keygen -t rsa -b 2048
$ cat ~./ssh/id_rsa.pub
Step #2: Create a Virtual Machine
Now you can start creating your Virtual Machine. In Azure, the services are called “resources”. Therefore you should start by clicking the green “+” sign to create a resource, then follow these steps:
- Go to Gets Started list and select Compute
- Select the Instance of your choice,
- Click OK
- Enter VM name
- The default disk type for VMs is SSD, you can also select HDD to get a low cost and slow speed option.
- Then enter the Username that would be your root user
- Now you select the Authentication type SSH public key
- Paste the content of the SSH public key you generated, in the SSH public key field.
- Select Resource Group, as it allows you to group all resources together. It works like the tags in AWS.
- Click OK
- Choose a VM size, you can go with a B1 General Purpose for starters. Click Select.
- Then you may require to select an Availability Zone or you can use the default Network and Subnet settings.
- Open Select public inbound ports and choose SSH and HTTP, to enable these ports to connect on this VM.
- Review Summary and click Create.
Step #3: Verify Resources
- Select Virtual Machines in the left panel
- Click Refresh to check if your new VM shows in the list
- Status should appear as Running after a moment.
Step#4: Connect to your VM
- Click on VM name as it appears on the list, this opens another summary panel.
- Click Connect
- Go to the Login using VM local account field. Copy the command.
- Execute the command selecting your Terminal.
Way to go!!! You just successfully created your first Linux VM in Azure Cloud. It is important to delete the resource group, virtual machine, and all related resources when you don’t need them any longer to avoid incurring in hidden charges. To do so, just select the resource group for the virtual machine, select Delete and confirm the name of the resource group to delete.
With the increasing popularity of Linux in Azure, it is important to take advantage of the support Microsoft is giving to it. Moreover, Azure brings backup and recovery options that are superior to other solutions, with multi-region replication across availability zones. In this article, I have reviewed some of the considerations for choosing to implement your Linux Virtual Machine in Microsoft Azure. I’ve also provided the first steps to create and connect a Linux Virtual Machine in Microsoft Azure.