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

Lionell Jenious
7 min readJul 29, 2024

--

Cloud Project — Azure Files, Azure Backup, Virtual Network, Resource Group, Azure Recovery Services Vault, Virtual Machine

In this project, reflecting a practical scenario, I functioned as a Cloud Specialist to enhance and transition an on-premises infrastructure to Microsoft Azure. The process involved deploying a series of Virtual Machines, setting up the necessary infrastructure, establishing a shared file system, and migrating backup solutions from tape to cloud-based backups with an impressive 99.9% availability.

To manage and organize resources, I utilized a Resource Group. For the network setup, I implemented a Virtual Network (VNet) with a subnet designed for provisioning two Application VMs. The shared file system was established using Azure Files to facilitate smooth interaction between the Application VMs.

For backup and recovery, I leveraged the robust capabilities of Azure Backup and Azure Recovery Services. This included configuring file backups within the shared file system and ensuring their transfer to the Recovery Services Vault, thereby enhancing the reliability and security of our backup solutions.

Solution Architecture — On Premise to Azure using Azure Backup Solution

Deployment Steps Performed:

Step 1: Created Azure VM1 and VM2

Step 2: Created a File Share

Step 3: Connected/Mounted the File Share into the VMs

Step 4: Created Fake Files in the Filesystem

Step 5: Set up the Backup using Azure Backup

Step 6: Deleted Files to Simulate Data Loss

Step 7: Restored Files

Step 8: Validated Restored Files

Summary of Experience:

“In this project, I successfully modernized an on-premises infrastructure environment by migrating it to Microsoft Azure. The key components of this modernization included deploying Virtual Machines, creating a shared file system, and implementing a robust cloud-based backup solution.

Step 1: Creating Azure Virtual Machines (VMs):

I began by provisioning two Azure Virtual Machines (VM1 and VM2) within a Virtual Network (VNET) and a subnet. This setup ensured that the VMs were in a secure and isolated environment, facilitating seamless communication and resource sharing.

Two Virtual Machines deployed in the same virtual network

Step 2: Creating a File Share:

Using Azure Files, I established a shared file system that could be accessed by both VMs. This shared storage solution provided a centralized location for application data, enhancing collaboration and data consistency\

File Shares Resource Group: azurebootcamp; Account: tcbstorageproject

Step 3: Connecting/Mounting the File Share:

I connected and mounted the Azure File Share to both VMs, ensuring that the shared storage was accessible and usable from each VM. This step was crucial for data storage and access in a multi-VM environment.

Technical Steps

Here is a step-by-step breakdown of the script to create a local directory and mount it to app-shared:

Explanation of Each Command Line Syntax with CLI Output

Syntax for local directory and mounting to app-shared

Create the Local Directory:

  • This command creates a local directory called app-shared under /mnt where the shared files will be mounted.

Ensure smbcredentials Directory Exists:

  • This checks if the directory /etc/smbcredentials exists. If not, it creates it. This directory will store the credentials needed for accessing the Azure file share.

Create Credentials File:

  • This checks if the credentials file exists. If not, it creates a file named tcbstorageprojects.cred and writes the username and password into it.

Set Permissions on the Credentials File:

  • This sets the file permissions to 600, meaning only the root user can read and write to this file, securing the credentials.
Creating the Local Directory /mnt/app-shared

Though the tcbstorageprojects.cred file is used only for this sandbox use case, it stores the credentials in clear text, which presents a security concern. While the file permissions are set to 600, allowing only the root user to read and write to it, storing credentials in clear text is not ideal for security reasons.

To enhance security, consider using more secure methods, such as Azure Key Vault, for storing and accessing these credentials.

Add the Mount to /etc/fstab:

  • This command appends an entry to /etc/fstab to mount the Azure file share to the local directory /mnt/app-shared with the specified options. This ensures the share is mounted automatically at boot.

Mount the File Share:

  • This command mounts the Azure file share to the local directory using the provided credentials and options. The -o flag specifies the mount options, ensuring the directory and file modes are set correctly and optimizing file access.
Verify Azure File Share

By following these steps, we securely mount the Azure file share to a local directory, allowing seamless access to cloud-stored files as if they were on the local filesystem.

Step 4: Creating Fake Files:

To simulate real-world data usage, I created multiple test files within the shared file system. These files served as placeholders for actual application data, allowing me to test the backup and recovery processes effectively.

Multiple files were created as placeholders to simulate application data for testing purposes
Verify Azure File Share

Step 5: Setting up Azure Backup / Running Job:

Leveraging Azure Backup, I configured a backup solution for the shared file system. By creating a Recovery Services Vault, I ensured that the backup data was securely stored with high availability (99.9% SLA). Azure Backup’s reliability and ease of use were evident throughout this process.

Configure Azure Storage Accounts
Run Backup Job for app-shared
Backup Job — Triggered
Backup Job completed
Backup Successful
Snapshot in Backup
Verified app-shared files (1–5) were successfully backed up.

Step 6: Simulating Data Loss:

To demonstrate the effectiveness of the backup solution, I deleted specific files (file2.txt and file5.txt) from the shared file system. This simulated a common real-world scenario of accidental data loss.

Before Simulated Data Loss in the app-shared storage directory
Simulated Data Loss — (file2.txt and file5.txt)

Step 7: Restoring Files:

Utilizing Azure Backup, I initiated the restore process for the deleted files. The straightforward restoration procedure underscored Azure Backup’s efficiency in recovering lost data quickly and accurately.

Prepare to Restore Files via Simulated Data Loss — (file2.txt and file5.txt)
Selected files (1 and 5) for restoring.
Restored files (2 and 5).

Step 8: Validating Restored Files:

Finally, I verified the successful restoration of the deleted files by listing the contents of the shared file system and displaying the contents of the restored files. This validation confirmed that the backup and recovery solution functioned as intended.

Overall, this project demonstrated my understanding and capability to modernize infrastructure using Microsoft Azure’s powerful storage and backup solutions. The experience highlighted the importance of cloud-based backups in ensuring data availability and resilience, thereby reinforcing best practices in cloud infrastructure management.”

Before and After Simulating File Deletion

Summary

In this project, I successfully modernized an on-premises infrastructure environment by migrating it to Microsoft Azure. The process involved provisioning two Azure Virtual Machines (VM1 and VM2) within a secure Virtual Network, establishing a shared file system with Azure Files, and connecting and mounting this file share to both VMs.

To simulate real-world usage, multiple test files were created in the shared file system. Leveraging Azure Backup, I set up a robust backup solution by creating a Recovery Services Vault.

I demonstrated the effectiveness of the backup solution by deleting specific files to simulate data loss, then restoring them using Azure Backup, and finally validating the successful restoration of the files.

Lastly, this project showcased the capability to modernize infrastructure using Azure’s storage and backup solutions, emphasizing the importance of cloud-based backups for data availability and resilience.

--

--

Lionell Jenious
Lionell Jenious

Written by Lionell Jenious

Cloud Software Network Engineer | AWS | AI/ML | Blockchain | Azure | Google Cloud | VMware | Cloud Computing | DevOps | Software Defined Networks SD-WAN

No responses yet