Understanding backup and restore for Azure VMs
In one of the previous chapters (Chapter 5, Provisioning Azure Virtual Machines), we had a chance to deploy Azure VMs in different scenarios, but we never mentioned how one can back up and restore a machine if something goes wrong or a machine is lost. Let’s see what the options in Azure are when it comes to backups.
Setting up backup for Azure VMs
To get started, we’ll need a machine – use the following script to create an empty resource with a known configuration:
az group create -l <location> -n <resource-group-name> az vm create -g <resource-group-name> --image Ubuntu2204 --name <vm-name>
However, to enable backup for our machine, we’ll need one more resource – a Recovery Services vault. You can think about it as a place that holds the configuration of backups for a given VM and is responsible for performing them according to a configured backup policy. To create...