How to Create a Virtual Machine in Azure

How to Create a Virtual Machine in Azure


3 min read

This guide provides step-by-step instructions on how to create a virtual machine in Azure. It covers all the necessary details, from navigating the Azure portal to configuring the virtual machine settings. Following this guide will allow someone to easily create a virtual machine in Azure for their specific needs.

Step by Step instructions-

  1. After registration navigate to

  2. Click on Create a new Resource.

    (any "entity" or service is a resource in Azure, for ex a VM is a resource, a Database will be a resource, a domain name is a resource etc)

  3. Search or select "Virtual Machine"

  4. Click on "Create" to create a VM.

  5. Select your subscription (appears by default)

  6. Create a new Resource Group, let's call it "testResource"

    (a resource group as the name signifies is a group of resources combined to deploy an application for ex- a vm+database+ip+domain together make, so they can be put together in ashutosh7iResource group for easier management)

  7. Enter the Virtual Machine Name, I name it "testVM"

  8. You can choose other Availability options and zones, (i'll choose East Asia)

  9. Here comes the main part, Select your preferred linux distro, for this tutorial we will go with Ubuntu.

  10. Select vm size, for a simple vm, we wont need higher resources, so lets choose the cheapest.

  11. Now we have to set Authentication type or say how would we connect to our vm after deployment,

    for a new machine there are two ways-

    1. Cloud shell, a shell inside browser, used for emergency cases.
    2. SSH, the recommended way.

    In SSH there are two methods, we will go with 2nd method that uses much simpler username and password to connect to our vm.

  12. Enter username and Password. (write down or copy somewhere too)

  13. Click "Allow selected ports" and select HTTP, HTTPS & SSH ports, this will save us time during connection web server installation.

  14. Click "Next : Disks >" (now most of the configuration should be left as it is)

  15. Click "Next : Networking >"

  16. Click "Next : Management >"

  17. Disable Auto-Shutdown, Click "Next: Monitoring>".

  18. Click "Next : Tags >"

  19. Click "Next : Review + create >"

  20. Here you can verify your resources and hourly cost

  21. Click Create when upon verifying details.

  22. After some time your deployment will be complete, go to Resource.

  23. Congratulations your VM is deployed successfully.๐ŸŽ‰๐ŸŽ‰

    ok now how to connect?

    Now, let's learn how to connect to your new VM:

  24. To Connect use this IP , username and your password.

    1. Open any shell.

    2. Enter command-

       ssh username@serverIp  {press enter}
       password:  {enter password} {press enter}
    3. Example-

      On Windows, press Win+R, type "cmd," and press Enter. Then, enter the command as above.

  25. Now, you have the power of Linux at your fingertips. Try out some Linux commands and explore your new virtual machine! ๐Ÿง๐Ÿ’ป


    In this step-by-step guide, you've learned how to create a virtual machine in Azure, from signing up and configuring settings to connecting to your new VM. Now it's time to explore your virtual machine.

    for any issues you can always reach me out on Linkedin

    Happy Hacking! โ˜๏ธ๐Ÿš€

Did you find this article valuable?

Support Aashutosh Soni by becoming a sponsor. Any amount is appreciated!