DEV Community

Cover image for Azure Virtual Machine
Tanveer Shahriar Arnob
Tanveer Shahriar Arnob

Posted on

Azure Virtual Machine

Microsoft Azure is a cloud computing platform that provides a wide variety of services.

Create Azure Virtual Machine

  • Search for Virtual Machines

Search Virtual Machines

  • Clink on create and select Azure virtual machine


  • Select resource group, give virtual machine a name and select region, availability option, image etc. as your need. Then click review + create.

Configure Virtual Machine

  • Finally this page will show if everything is ok for the virtual machine and also the cost per hour for using that virtual machine. After that press create.

Final Create

  • Then like the below picture you have to download private key for SSH connection. So press download private key and create resource.

Download Private Key

  • Finally your virtual machine will be created and you will get the dashboard. From here you can configure, stop or delete the virtual machine.

Virtual Machine Dashboard

  • Then if you want to connect via SSH with client search for connect and something like the image below will appear. There you will find commands for connecting. You have to run those commands in the cloud shell.

SSH connect

  • After that to update your software or install anything (for demo let's install nginx) run below command.
sudo su
apt-get -y update
apt-get -y install nginx
Enter fullscreen mode Exit fullscreen mode
  • Also if you know that what you will install before creating virtual machine, then you can configure a cloud init while creating the VM which will automatically run all your commands. For configuring cloud init you have to go to advance tab and write the commands in the custom data and cloud init section like the image below.

Cloud init

And that's how you create a VM. But you have to know two things --

  1. While creating VM it automatically creates a disk which is the storage for the image or operating system.
  2. People may think that, if we stop the VM then it will not cost anything. But the truth is, as it has a default disk connected with it, even if we don't have to pay for the VM, we have to pay for the disk. So simply stopping the VM will cost less but it's not going to be 0.

Thank you everyone. That's it for today. Feel free to ask any question in the comment.

Top comments (0)