From the course: Microsoft Azure Administrator Associate (AZ-104) Cert Prep by Microsoft Press

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Creating a VM using the Azure CLI

Creating a VM using the Azure CLI

- [Instructor] In this lecture, we're going to create a virtual machine within Azure, but we're going to create it using the command line. I've a couple of things already set up. The first is I've got a resource group called rg-MyFirstResourceGroup. In here, there's some bits that we don't really need, such storage accounts. I've got a virtual machine in there. Again, that doesn't matter. But what is important, I've got this VNET called VNET-Two. And that's the VNET that I'm going to connect our virtual machine to. And that's the VNET that it will pick up an internal IP address from. So I'm going to do this using the Cloud Shell. And the command to create a virtual machine using the Azure CLI is az vm create. Now, when we do this through the portal, there's lots of things we can choose when we are configuring our virtual machine. And again, all these things we can generally do on the command line, but I'm just going to go through some absolute basics that we need. The first, we need…

Contents