O'Reilly logo

Hands-On Networking with Azure by Mohamed Waly

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating an Azure VM using Azure CLI 2.0

Unlike Azure PowerShell, Azure VM creation in Azure CLI 2.0 can be done with only two commands.

The first command creates a storage account to store the VM data in; perform this with the following command:

Az storage account create --location westeurope --name packtpubsacli--resource-group PacktPub --sku Standard_LRS

Now you can create the VM by running the following command:

az vm create --resource-group PacktPub --name PacktPubVMCLI --location westeurope --size Standard_DS2 --image win2016datacenter --storage-account packtpubsacli --use-unmanaged-disk --vnet-name PacktPubvNet--vnet-addressprefix 192.168.0.0/16 --subnet S1 --subnet-address-prefix 192.168.1.0/24 --admin-username mwaly --admin-password ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required