In cloud environments, things are quite different—once a machine is not needed, it should be deallocated to save money. In this section, you will learn how to create a schedule for starting and stopping an Azure VM so that it reflects the team's workday. 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 reference Chapter 3, Configuring and Managing Virtual Networks, for complete instructions on how to use the command line or PowerShell for VM creation):
az vm create
The same functionality is available via a PowerShell cmdlet:
New-AzureRmVM
Remember to pass all the required parameters (name of the machine, resource group) and enter the expected VM size (by providing the --size parameter), then wait a few minutes for the process to complete. If you want, you can also use the Azure portal and create a machine using the step-by-step wizard...