How to create your first Virtual Machine instance on Azure

Ashar Malik
5 min readAug 6, 2022

Do you know that you can use a computer which is located thousands of miles away from you? If your answer is no, then let me show you how you can do this.

Cloud is a virtual space on the internet. It allows you to do many things but one of its outstanding services is that it allows you to create a virtual machine to use remotely. All you need is just a basic computer and an internet connection.

Many companies such as Google, Microsoft and Amazon provide cloud services . We will be only focusing on Microsoft Azure but the process of creating a VM instance is almost the same on other clouds.

Azure provides a free trial for 1 month which is all you need to get started. Once you have the subscription, go to the Azure portal and sign in. After you have signed in, your Home screen will look something like this.

Home screen of the Microsoft Azure
Azure Home screen

Click on the create a resource as shown in the image. Now your screen should look something like this.

creating a virtual machine resource
Creating a virtual machine resource

Here you have options to create a variety of resources. we want to create a virtual machine, so we will select create virtual machine as shown in the figure.

After clicking create the virtual machine, a screen like this should appear.

specifying the details of the virtual machine
virtual machine specification details

Here you have multiple tabs (i.e. Basics, Disks etc). In every tab, you specify some specifications of your virtual machine. Once all the required specifications are complete, your virtual machine will be created.

Azure does a pretty good job at facilitating its users. It fills out most of the required details by default and you don’t have to do much. But you can always change anything you want.

1. Create the virtual machine with the following basic configurations:

  • Subscription: If you are on the free trial, you have Azure subscription 1 subscription which should be selected by default. But if it's not, then you can select it.
  • Resource group: create a new resource group by clicking on create new. give it any name you like.
  • virtual machine: give it any name you like.
  • Image: This is where you select the operating system on your virtual machine.
  • Size: This is where you specify how powerful machine you require. You have different sizes available. Select the size according to your needs and budget. Don’t select too cheap because your VM will be very slow if you do. I would recommend selecting B2s.
  • Administrator account: Here you have 2 options to login into your administrator account on your virtual machine. ssh public key and password. Choose what’s appropriate for you and fill the required fields. I recommend going with the ssh public key for password-less login.
  • Inbound port rules: Here you specify how you will connect to your virtual machine. By default SSH (22) is selected. Leave it as default and click on next.

2. On the Disks tab:

  • OS disk type: By default, a disk that is compatible with your VM instance is selected. Leave it as default. Leave all other options on this tab as default and click on the next. This will take you to the networking tab.

3. On the Networking tab:

All the essential network details are filled out for you. You don’t have to do anything. If you want your virtual machine to allow connection on a port other than SSH (22), you can do that with the Select inbound port option on this tab.

Now, click on the next. This will take you to the management tab.

4. On the Management tab:

  • Boot diagnostics: This feature is enabled by default. Disable it to save some money. You don’t need it unless you are troubleshooting boot-up problems.
  • Auto shutdown: This feature allows you to automatically shutdown your virtual machine outside your working hours. You can specify the time when you want to shutdown your machine. Enable this feature to shutdown your virtual machine when you are not using it, to save some money.

5. On the Advanced tab:

Here you can specify applications and configurations that you want to be installed on your VM when it is created. We don’t need it so will skip it. Simply click on next. Skip the tags tab too and jump to the Review+create tab.

This will take some time to validate your given details and then you will get an option to create. After you click create button, it will take some time to deploy your virtual machine.

create the virtual machine
create the virtual machine

If you have selected the ssh key pair to login, then after clicking the create button you should get this screen.

private key download
private key download

Azure doesn’t store your private key so this is the only time you can download your key. Download it and store it in a location you want.

After some processing time, you will get the following screen which means that your virtual machine is successfully deployed.

virtual machine successfully deployed
virtual machine successfully deployed

You can now come back to your home page. Click on the virtual machine section. You will now see a virtual machine resource.

virtual machine created in the virtual machines section
virtual machine created

Depending upon the authorization method you selected while creating the VM (key or password), you can login into the VM. Simply click on the VM to connect.

If are like me and you have selected the key for login, this screen should appear for you to login.

SSH connection
SSH connection

Click on the SSH to connect. simply follow the instructions provided and you will login into your virtual machine.

Congratulations! You have created your first virtual machine on Azure. Now you can experience the power of using a remote computer.

Conclusion

Using a virtual machine on cloud is a cheap and efficient alternative of buying an expensive computer. You can increase or decrease its hardware specifications anytime. In this tutorial, you learned how to create your own virtual machine on Microsoft Azure cloud. But the process of creating a virtual on other clouds is pretty much the same.

--

--