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 P@cktPub@2018
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset