Creating Virtual Machine in Azure for free
Tags: virtualmachine, azure, cloud, linux
Published: 2024-05-23 02:24:17

This is a walkthrough for setting up **linux machines in Azure VM with Persistent storage and SSH Connection**.



> If you are student 
> claim your $100 Free Credit (_No Credit/Debit card required_):
> https://azure.microsoft.com/en-in/free/students


Step-by-step procedure:

Go to: https://portal.azure.com/ 
login with same account, which you have used to claim student credit.


Click "Create a resource"

![Step 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t72gjy138dafvpyumpzl.png)


Click "Create" under "Virtual Machine"

![Step 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f01j6ab5zl0gszivsxx7.png)


Under resource group, click "Create new"
Fill the details of your choice

![Step 3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/13mtgwzdu0atmw804tgs.png)


Choose the settings of your choice, 
Image - Is the OS that will be installed your VM, I have chosen "Debian" there are many more options linux, windows etc...

![Step 4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z22gpyjn0kbun5ee3n1u.png)


Setup username and password for your cloud VM and select all SSH, HTTP, HTTPS ports. In the bottom select "Next: Disks >" 

![Step 5](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aaj4u6mrzh7lcixfu9wq.png)


Choose the storage capacity according to your need. Then click "Review + create"

![Step 6](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2g2s5bnh1mzcxe1ifbi9.png)


Review your settings, Then the deployment will take some time.

![Step 7](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gmi6eprav9k3rv259ctr.png)


![Step 7.1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/16vwy5h6jfmkvtyayim1.png)

Wait for few minutes, Once it is loaded go to "Network settings", In the bottom right corner, Select "Create Port Rule" and "Inbound Port Rule"

![Step 8](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y4h0ffpoavr5p2f5kbzn.png)


Enter details same as in this picture, and click "Add" at the bottom on the right screen


![Step 8.1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x6sqc1qzce7vofjlsdyp.png)


![Step 8.2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cbr3rt0jir0yll34hpqp.png)


![Step 8.3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bqm7v3amhn1oz103chj5.png)


Go to "Overview" tab on the left option and select "Restart"

![Step 9](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b9dosxyzdkrp4bq2pmvk.png)


Once it is done, Copy the PUBLIC IP ADDRESS of you VM, It can be seen in "Overview" tab

Public IP Address: XXX.XXX.XXX.XXX

In order to use the VM, Either you can choose "Connect" in the "Overview" tab or in your local machine terminal or command prompt

`ssh <your cloud username>@your cloud vm public ip address`
`ssh raghavtwenty@xxx.xxx.xxx.xxx` 

Enter your cloud machine password to use the VM


![Step 10](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v75ppv06vt1lmr0oqyug.png)


Now the Cloud VM is ready to use, You can perform all terminal based command operations.

When you exit in the "Overview" tab, Select "Stop" to shutdown the machine.