Author : MD TAREQ HASSAN | Updated : 2020/11/09

Prerequisites

Create required resources beforehand to use those during VM creation. If not created beforehand, required resources will be created during VM creation.

Create Resource Group:

Create required resources:

Azure CLI installation

Download and install Azure CLI: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli

Create Virtual Machine

Commands to create VM (Cloud Shell is preferred)

az account list --output tsv

az account set --subscription "Free Trial"

az group create --name IaaS-cli-rg --location japaneast

az vm create \
    --resource-group IaaS-cli-rg \
    --name IaaS-cli \
    --location japaneast \
    --vnet-name IaaS-cli-vnet \
    --subnet IaaS-cli-subnet \
    --nsg IaaS-cli-nsg \
    --public-ip-address IaaS-cli-ip \
    --image win2016datacenter \
    --admin-username vmiaasdemo \
    --admin-password VMiaasdemo.001

az vm open-port --port 80 --resource-group IaaS-cli-rg --name IaaS-cli

Connect to virtual machine

See: Connecting to virtual machine