The best Azure learning site: Azure Documentation Center / Microsoft Learning
Restore a single file using Azure Backup
Earlier, I introduced how to use Azure Backup to back up cloud VMs and use the backup files to restore when there is a problem with the virtual machine. However, the method of directly recovering virtual machines is not suitable for all business scenarios. In many cases, we hope to have some fine-grained recovery control. For example, the operation and maintenance personnel accidentally deleted or changed some important configurations during the configuration of the system. In this case, we can use Azure Backup to restore based on the file level. Compared with restoring the entire VM, the interruption time and workload of the business can be greatly reduced. For more information about Azure Backup, you can refer to the following address:
https://docs.microsoft.com/en-us/azure/backup/backup-overview?WT.mc_id=AZ-MVP-5002232
Let's take a look at how to restore a single file using Azure Backup.
prerequisites
To perform this experiment, the following prerequisites must be met:
- Azure subscription
- A Linux virtual machine running Nginx
Enable Azure Backup for the virtual machine
Delete files from the VM
We deleted webpage files from the VM to simulate misoperation, which caused the site to be unavailable.
Log in to Azure Portal and find the VM we have prepared:
You can see that the current Nginx site is running normally by visiting the public IP address:
SSH to the server, run rm -rf /var/www/html/index.nginx-debian.html to delete webpage files:
After deleting, visit the site, you can see the site access exception:
Generate file recovery script
In the scenario of recovering a single file, Azure Backup provides a recovery script to connect the recovery point to the VM as a local disk. After connecting, we can browse the disk to restore the file. The recovery point can be disconnected after the file is restored.
Click on all services, click on restore service vault:
After entering the recovery service vault, click on the backup item, and then click on the Azure virtual machine:
Click on the Demo-Web01 we want to use:
In the backup item, click File Recovery:
On the File Recovery tab, select the recovery point you want to use, then download the script and record the script running password:
Restore files to VM
Log in to the virtual machine and find the script file we downloaded:
After running the script file, we will be asked to enter the password, we can enter the password recorded before:
The recovery point is mounted:
Find the file to be restored in the local drive mounted on the restore point to restore:
After the restoration is complete, we visit the previous site again and we can see that we can access it normally:
After the recovery is complete, we need to cancel the mount of the recovery point in the file recovery menu:
The cancellation is complete, as shown in the figure below:
This is the end of the operation of using Azure Backup to restore a single file. I hope it will be helpful to you.
For more information, please refer to the following link:
https://docs.microsoft.com/en-us/azure/backup/backup-overview?WT.mc_id=AZ-MVP-5002232