To get started, you will need a working VM. If you do not have one, you can quickly deploy one. To do so, use the following Azure CLI command:
# You can find all the available options for this command by running `az vm create -h`
az vm create --size VmSku -n MyVm --resource-group MyResourceGroup --image VmImage
The same functionality is available via a PowerShell cmdlet:
# https://docs.microsoft.com/en-us/powershell/module/azurerm.compute/new-azurermvm
New-AzureRmVM
Remember to pass all the required parameters and enter the expected VM size (see the preceding Azure CLI command) and wait a few minutes for the process to complete. If you want, you can also use the Azure portal and create a machine using a step-by-step wizard:
Figure 6.1 – Configuring a new VM
To attach a data disk to a VM, you will have to create one. To do so, use the following command:
az disk create --resource-group "<resource-group-name>" --name "<disk-name>...