Infrastructure modernization from on-premises to Microsoft Azure with backup solution using Azure Files, Azure Backup and Recovery Services Vault.

A R
6 min readJun 11, 2024

--

In traditional corporate data center (on-premises), shared data from the servers are backed up in a Tape for backup and recovery purpose. In modern architecture in cloud, the shared files of virtual machines are stored in a file share storage such as Azure File Share. Then these files are backed up by Azure Recovery services vault for backup and recovery. In this hands-on, we practice the same scenario and simulate a data loss due to accidental deletion in Azure File Share. We restore the lost data from Azure Recovery Services Vault.

In this project based on a real-world scenario, I acted as a Cloud Specialist to modernize and migrate an on-premises infrastructure environment to Microsoft Azure. I deployed a set of Virtual Machines, the infrastructure, a shared file system and replaced backups from tape to cloud backups with 99.9% (3-nines) availability.

I used a Resource Group to organize resources, a VNet with a subnet where we would have the provisioning of 2 Application VMs and Azure Files as a shared file system solution between our Application VMs.

All the power and reliability of Azure Backup with Azure Recovery Services have been used to configure the backup of files in the shared file system. Once again, Azure Backup has been used to move the files to the Recovery Services Vault.

Implementation:

Step1. Creating Azure VM1 and VM2

Create the VMs with default settings.

Step2. Creating a file share
Create a storage account or use an existing one.

In the storage account, click on File Shares, create new File Share, name it app-shared.

You can change the quota to 1 GiB for lesser cost.

Click on the “connect” option, select OS type Linux, then copy the script required to mount the File Share.

Step3. Mount File Share on each VM.

Ssh your app01 VM using GitBash and run “df -kh” command to check files status. You see there is no File share mounted.

Run the script in GitBash in each VM.

sudo mkdir /mnt/app-shared
if [ ! -d "/etc/smbcredentials" ]; then
sudo mkdir /etc/smbcredentials
fi
if [ ! -f "/etc/smbcredentials/tcbstorageprojectzr.cred" ]; then
sudo bash -c 'echo "username=tcbstorageprojectzr" >> /etc/smbcredentials/tcbstorageprojectzr.cred'
sudo bash -c 'echo "password=c4Z9o2mwN6fFXo+6L9WoZIE4R7Ib5oimWF77LVUE3A7Jh3N6XWLqYnPi7rYmc9t56pwh8joAXCf+ASt1StKvw==" >> /etc/smbcredentials/tcbstorageprojectzr.cred'
fi
sudo chmod 600 /etc/smbcredentials/tcbstorageprojectzr.cred

sudo bash -c 'echo "//tcbstorageprojectzr.file.core.windows.net/app-shared /mnt/app-shared cifs nofail,credentials=/etc/smbcredentials/tcbstorageprojectzr.cred,dir_mode=0777,file_mode=0777,serverino,nosharesock,actimeo=30" >> /etc/fstab'
sudo mount -t cifs //tcbstorageprojectzr.file.core.windows.net/app-shared /mnt/app-shared -o credentials=/etc/smbcredentials/tcbstorageprojectzr.cred,dir_mode=0777,file_mode=0777,serverino,nosharesock,actimeo=30

After running the command, you see the file share mounted.

Repeat the same process with VM app02.

Step4. Creating dummy files in the filesystem

create some files in app01, and verify if they are written on file share.

Verify it in azure console too.

echo 'Contents of file 1' >> /mnt/app-shared/file1.txt
echo 'Contents of file 2 ' >> /mnt/app-shared/file2.txt
echo 'Contents of file 3' >> /mnt/app-shared/file3.txt
echo 'Contents of file 4' >> /mnt/app-shared/file4.txt
echo 'Contents of file 5' >> /mnt/app-shared/file5.txt

Step 5. Setting up the Backup using Azure Backup

Click on backup in azure File Share and enable backup.

This process will create a Recovery Services Vault. Confirm the service registration is completed by going to the backup jobs and click on the storage account.

The backup registration process is completed. Go back to the file shares to initiate the first backup.

Once the backup process is completed, verify the backup by checking “backup jobs” status in your Recovery Services Vault.

Go back to File Shares and click on snapshot. The first snapshot is in fact the back of the files initiated.

Step 6. Deleting and Recovering files file2.txt and file5.txt to simulate data loss

Delete file1 and file2.

Files recovery process:

If you click on the backup in your File Share, you will see a new option “File Recovery” is enabled. Click on it to initiate recovery of lost files.

- Select the recovery point which is earlier backup.

- Restore destination: it is recommended to use alternate location and not to overwrite the original data, so select “skip” option.

- Add the files that were deleted.

In recovery services vault, the recovery job is in progress. Wait till status shows completed.

Step 7. Validating files restored
ls -ltr /mnt/app-shared

Conclusion and Key Insights:

File sharing, backup, and recovery are standard practices in on-premises environments. With the advent of cloud technology, File Shares and Recovery Services Vault have streamlined these processes, making them simple and efficient. Many organizations that have migrated their workloads to the cloud continue to rely on these services.

For a Cloud engineer, proficiency in backup and recovery is essential for maintaining smooth daily operations. Azure Recovery Services Vault offers various options to ensure data is securely backed up and easily recoverable. Features such as point-in-time recovery, Recovery File, Recovery Share, and Soft Deletes are crucial measures to minimize data loss and enhance data protection.

--

--

A R
0 Followers

Infrastructure Engineer with focus on Cloud & DevOps | AWS | Microsoft Azure | Google Cloud | Oracle Cloud | IBM | AI-ML