Az VM create

This Azure CLI article discussed the syntax and usage of the Az VM create command with certain examples of how to use this command.

Az VM create

You can use the az vm create command to quickly create an Azure Virtual machine using Azure CLI.

Syntax of Az VM create:

The syntax is as below

az vm create --resource-group Resource Group Name  --name VM Name --image Win2016Datacenter --admin-username User Name --admin-password "Your Password" --location Location Name

Az VM create Examples:

Consider the below example

az vm create --resource-group Demo789 --name APPLEVM --image Win2016Datacenter --admin-username rajkishore --admin-password "Password@123" --location eastus

In the above example.

  • Demo789 — The name of the Resource Group.
  • APPLEVM— Virtual machine name.
  • Win2016Datacenter — Image name.
  • rajkishore–The local admin username for the VM.
  • Password@123 –The local admin password for the Virtual Machine.
  • eastus — The location name.

After executing the above command, I got the expected output as below and the Virtual Machine has been created successfully.

{
  "fqdns": "",
  "id": "/subscriptions/1cdf4300-dee5-4518-9c9c-feaa72a5cbd1/resourceGroups/Demo789/providers/Microsoft.Compute/virtualMachines/APPLEVM",
  "location": "eastus",
  "macAddress": "7C-1E-52-15-D4-42",
  "powerState": "VM running",
  "privateIpAddress": "10.0.0.4",
  "publicIpAddress": "137.117.73.79",
  "resourceGroup": "Demo789",
  "zones": ""
}

You can check out the same output in the below screenshot.

Az vm create

Az VM create Command – Video Tutorial

You may also like following the articles below

Conclusion

This article discussed the syntax and usage of the az vm create command, which allows you to quickly create an Azure Virtual machine using Azure CLI.