---
title: "Discover How to Create an Azure VM in Microsoft Azure Cloud"
description: "Learn the many ways how to create an Azure VM in the Microsoft Azure Cloud and move your resources and processes into the cloud!"
canonical: "https://adamtheautomator.com/create-an-azure-vm/"
---

# Discover How to Create an Azure VM in Microsoft Azure Cloud

> Learn the many ways how to create an Azure VM in the Microsoft Azure Cloud and move your resources and processes into the cloud!

Source: https://adamtheautomator.com/create-an-azure-vm/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Discover How to Create an Azure VM in Microsoft Azure Cloud](https://adamtheautomator.com/wp-content/uploads/2023/02/create-an-azure-vm.jpg)

# Discover How to Create an Azure VM in Microsoft Azure Cloud

[![](https://secure.gravatar.com/avatar/2beb65fca997135120ed98dc6a2e57dcdf1a7d7d2f5ff687b5d91dc7ccd7a6b5?s=192&d=mm&r=g)Sagar](https://adamtheautomator.com/author/shanky-mendiratta/)8 February 20236 min. read

Categories: [DevOps](/category/devops/)

Tags:[Azure](/tag/azure/)[Azure Virtual Machines](/tag/azure-virtual-machines/)[Microsoft Azure](/tag/microsoft-azure/)

Table of Contents

*   [Prerequisites](#prerequisites)
*   [Activating the Azure Cloud Shell to Create an Azure VM](#activating-the-azure-cloud-shell-to-create-an-azure-vm)
*   [Create an Azure VM via the Azure Portal](#create-an-azure-vm-via-the-azure-portal)
*   [Conclusion](#conclusion)

If you plan to start with Microsoft Azure Cloud, nothing could be better than launching your first Azure virtual machine (VM). Azure VMs are hosted on hypervisors, where you can customize all software, such as operating systems (OS), configurations, and so on,

In this tutorial, you will learn how to launch your first Azure VM via Azure Cloud Shell and Azure Portal.

Read on and start your journey to cloud computing!

## Prerequisites

This tutorial comprises step-by-step instructions. To follow along, be sure you have the following in place:

*   An [Azure account](https://signup.azure.com/signup) with an [active subscription](https://learn.microsoft.com/en-us/microsoft-365/enterprise/subscriptions-licenses-accounts-and-tenants-for-microsoft-cloud-offerings?view=o365-worldwide#subscriptions) or an existing sandbox subscription will suffice.
*   [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) version 2.0.79 or newer installed – This tutorial uses the 2.42.0 version.

Related:[How to Install Azure CLI (Windows, Linux, macOS, Azure Shell)](https://adamtheautomator.com/install-azure-cli/)

## Activating the Azure Cloud Shell to Create an Azure VM

Azure offers VMs, one of several [on-demand, scalable computing resources](https://learn.microsoft.com/en-us/azure/architecture/guide/technology-choices/compute-decision-tree) that improve operational efficiency. With Azure VMs, you can migrate business-critical workloads to [Azure infrastructure](https://azure.microsoft.com/en-us/resources/cloud-computing-dictionary/what-is-azure/azure-iaas/) without buying and maintaining the physical hardware that runs it.

When provisioning a resource on Azure Cloud, like a VM, you have two ways: Azure [Cloud Shell](https://adamtheautomator.com/azure-cloud-shell/) CLI (Interfaces) and Azure Management Console (Explorer).

Related:[Getting Started with the Azure Cloud Shell](https://adamtheautomator.com/azure-cloud-shell/)

These interfaces allow you to work with Azure Services via the typical Azure Cloud Shell (Commander style). But in this example, you will use the Azure Cloud Shell first to launch your first instance in Azure Cloud, as follows:

1\. Open your favorite web browser, and log in to [Azure Portal](https://portal.azure.com/#home).

2\. Next, click the Cloud Shell icon (upper-right) to launch the Azure Cloud Shell, as shown below.

![Activating Azure Cloud Shell](https://adamtheautomator.com/wp-content/uploads/2023/02/image-59.png)

Activating Azure Cloud Shell

3\. Next, run the below [`az vm`](https://learn.microsoft.com/en-us/cli/azure/vm?view=azure-cli-latest) command to launch `[(create](https://learn.microsoft.com/en-us/cli/azure/vm?view=azure-cli-latest#az-vm-create))` the instance named (`my-vm`) on Azure Cloud. Be sure you replace `<resource-group-name>` with your actual sandbox [resource group](https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/manage-resource-groups-portal) name. A resource group is a container that holds all the related resources within the Azure cloud.

```bash
# THE COMMAND BELOW PERFORMS THE FOLLOWING:
# Set resource group <resource-group-name> the instance will use.
# Set the name of the instance (my-vm).
# Set Ubuntu as the image.
# Set the admin username.
# Generate the keys you can use to login into the instance.
az vm create \
  --resource-group <resource-group-name> \
  --name my-vm \
  --image UbuntuLTS \
  --admin-username azureuser \
  --generate-ssh-keys
```

![Creating an instance via Azure Cloud Shell](https://adamtheautomator.com/wp-content/uploads/2023/02/image-60.png)

Creating an instance via Azure Cloud Shell

4\. Lastly, run the following command to [`list`](https://learn.microsoft.com/en-us/cli/azure/vm?view=azure-cli-latest#az-vm-list) all available instances by `name`.

```bash
az vm list | grep name
```

Below, you can verify your instance has been properly launched.

![Verifying the newly-created instance has been launched](https://adamtheautomator.com/wp-content/uploads/2023/02/image-61.png)

Verifying the newly-created instance has been launched

## Create an Azure VM via the Azure Portal

Launching your first Azure VM via CLI works great since it only requires a few steps. But if you prefer to click through configurations, your best option is the Azure Portal.

The Azure Portal provides a GUI where you can create and manage all your Azure resources, like your Azure VMs.

To create an Azure VM via Azure Portal’s GUI, follow these steps:

1\. On the Azure Portal, click **Create a resource** (upper-left), as shown below, to initiate creating a new resource.

![Initiating creating a new resource](https://adamtheautomator.com/wp-content/uploads/2023/02/image-62.png)

Initiating creating a new resource

2\. Next, click **Virtual machine,** as shown below, redirecting your browser to a page where you can configure your VM.

![Selecting Virtual machine as the resource](https://adamtheautomator.com/wp-content/uploads/2023/02/image-63.png)

Selecting **Virtual machine** as the resource

3\. Configure the **Project details** and **Instance details** for your VM as follows:

*   **Subscription** – Choose your Azure subscription and **Resources group**.
    
*   **Virtual machine name** – Set a unique name for your VM (i.e., **my-VM**).
    
*   **Region** – Choose the [region](https://azure.microsoft.com/en-us/explore/global-infrastructure/geographies/#overview) where you would like to launch your instance.
    
*   **Availability options** – Choose the **No infrastructure redundancy required** option. Availability options are designed to procure high availability, which you do not need for this tutorial.
    
*   **Security type** – Keep the **Standard option** selected not to restrict any rules, but you can apply rules in the future for particular traffic.
    
*   **Image** – Select the image as Ubuntu (any version above 16) or any other Linux machine you wish to launch.
    
*   **VM architecture** – Choose the 64-bit machines (**x64**) option. While Arm-based provides better price performant, 64-bit machines are much more software compatible.
    
*   **Size** – Choose the [size of the instance](https://learn.microsoft.com/en-us/azure/virtual-machines/sizes) you prefer.
    

![Setting the new VM’s basic details](https://adamtheautomator.com/wp-content/uploads/2023/02/image-64.png)

Setting the new VM’s basic details

4\. Now, scroll down, and configure the following:

**Administrator account**

*   **Authentication type** – Choose **Password** as the authentication type. You can choose the authentication type as **Password** or **SSH public key**, but keep it as **Password for this tutorial**.
    
*   **Username**, **Password**, and **Confirm Password** – Set a username and password, which you will use later to log in to your VM.
    

**Inbound port rules**

*   **Public inbound ports** – Choose the **Allow selected ports** option to allow users to access your machine based on the port you allow. For example, port 22 will enable you to log in, while port 80 allows you to access your server using a web browser.
    
*   **Select inbound ports** – Select **SSH (22)** from the dropdown field to allow all IP addresses to access your VM.
    

Once configured, click **Next : Disks >** to configure disk settings for your VM.

![Specifying administrator account and inbound rules](https://adamtheautomator.com/wp-content/uploads/2023/02/image-65.png)

Specifying administrator account and inbound rules

5\. Set the following for your VM’s disk configuration:

*   **OS disk type** – Choose storage per your requirement based on OS disk types. This tutorial’s choice is **Premium SSD**.**Delete with VM** – Tick this box to set the disk along with the instance deletion.**Key management** – Choose the key required to manage the instance from the dropdown.

After the disk configuration, click **Next : Networking >** to set up the VM’s network configuration.

![Specifying all the disk details for the instance](https://adamtheautomator.com/wp-content/uploads/2023/02/image-66.png)

Specifying all the disk details for the instance

6\. Next, specify **Network interface** details with the following:

*   Set the Subnets and the Public IP – Public IP address is used if you need your server to be accessible on the internet.

> _Subnets enable you to divide the virtual network into one or more sub-networks. Moreover, subnets allocate a portion of the virtual network’s address space to each subnet and further deploy Azure resources in a specific subnet._

*   NIC network security group – Choose Basic to specify the rule, such as which ports should be open to access the server.
*   Public inbound ports – Select the None option, as you do not need to choose any port for this tutorial. Public inbound ports are more granular network access. This setting defines which ports should be open and from which source or IP address.

Once VM’s network interface is configured, click **Next : Management** >to configure management options for the VM.

![Specifying networking components required for launching the instance](https://adamtheautomator.com/wp-content/uploads/2023/02/image-67.png)

Specifying networking components required for launching the instance

7\. Under the **Management** tab, click **Next : Monitoring >** to skip this step, and proceed to configure how you would like to monitor your VM.

> _If your company requires heavy security of your Azure VMs, integrate with [Azure Active Directory (Azure AD)](https://azure.microsoft.com/en-us/products/active-directory) authentication._

![Specifying if authentication is required or not by the VM](https://adamtheautomator.com/wp-content/uploads/2023/02/image-68.png)

Specifying if authentication is required or not by the VM

8\. Now, choose the monitoring details for your VM, whether you need to diagnose if any reboot happens or any issues on the disk, and click **Next : Advanced >**.

This tutorial’s choice for **Boot diagnostics** is the **Enable with managed storage account** option.

![Enabling the monitoring with managed storage](https://adamtheautomator.com/wp-content/uploads/2023/02/image-69.png)

Enabling the monitoring with managed storage

9\. Click **Next : Tags >** to skip changing any advanced settings. But if you wish, you can add the custom data, known as user data, in the **Custom data and cloud init** field. User data is the set of commands/data you can provide to an instance at launch time.

![Skipping advanced settings](https://adamtheautomator.com/wp-content/uploads/2023/02/image-70.png)

Skipping advanced settings

10\. Under the **Tags** tab, add tags (metadata elements) to apply to your Azure resources. Tags are key-value pairs that come in handy for administrators in identifying resources.

After adding tags, click **Next : Review + Create >** to validate the settings you selected for your VM.

![Adding tags](https://adamtheautomator.com/wp-content/uploads/2023/02/image-71.png)

Adding tags

11\. After validation, click **Create** (bottom-left) to launch your first VM instance on Azure cloud.

![Creating a new VM instance against the selected settings ](https://adamtheautomator.com/wp-content/uploads/2023/02/image-72.png)

Creating a new VM instance against the selected settings

Below, you can see the deployment is in progress.

![Viewing the deployment in progress ](https://adamtheautomator.com/wp-content/uploads/2023/02/image-73.png)

Viewing the deployment in progress

After the deployment completes, you will see all deployment details, such as VM name allocation, IP allocation, and so on.

![create an azure vm - Viewing the deployment process (step by step0](https://adamtheautomator.com/wp-content/uploads/2023/02/image-74.png)

Viewing the deployment process (step by step0

12\. Finally, navigate Azure Portal’s home page, and you will see the new VM and resource group listed, as shown below.

![Verifying the newly-created VM and resource group](https://adamtheautomator.com/wp-content/uploads/2023/02/image-75.png)

Verifying the newly-created VM and resource group

## Conclusion

In this tutorial, you have discovered how to quickly create an Azure VM in Azure Cloud Shell, with a few commands, and via the Azure Portal.

Regardless of which method you used to set up your Azure VM, you can run various applications in your instance, such as Ansible or Kubernetes. Furthermore, you can set up your Azure instance as your deployment or monitoring instance.

With a fully functional Azure instance running, why not test various software, such as Apache NGINX and Tomcat? Or maybe use it as an Ansible controller?

Related:[How to Build (And Actually Understand) a Solid Ansible Playbook](https://adamtheautomator.com/ansible-playbook-example/)

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fcreate-an-azure-vm%2F&text=Discover%20How%20to%20Create%20an%20Azure%20VM%20in%20Microsoft%20Azure%20Cloud)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fcreate-an-azure-vm%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fcreate-an-azure-vm%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2023/10/automating-azure-resource.jpg)

### [Automating Azure Resource Deployments in PowerShell: Part 1](/automating-azure-resource/)

Learn the many ways to get started with automating Azure resource deployments in part one of this three part series.

![](https://adamtheautomator.com/wp-content/uploads/publisher/2e05d9c85b2b8187b503fb0f6ceff47e/e15d54857176da3fe72b1f0692faaa7000367a5fbe6edf5f6a5f1034395fea45.webp)

### [Azure Bicep: Bulletproof Production Deployment Patterns](/azure-bicep-production-patterns/)

Own your Bicep blast radius: pin modules in a private registry, gate pull requests with lint and PSRule, and track production changes with stacks.

![](https://adamtheautomator.com/wp-content/uploads/publisher/2e05d9c85b2b819f93afc24ff9cf331a/cc243abf3399435c522e346ae33dfd425022d22b25c2f30ec3f4222e9b893e33.webp)

### [Azure DevOps Agent Pools: Fix Idle Agents and Queue Stalls](/azure-devops-idle-agents-queue-stalls/)

Diagnose idle Azure DevOps agents blocking your queue: check parallel jobs, agent demands, stuck leases, and pool scaling before you rebuild a pool.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
