Data Management in the Cloud: Creating and Restoring Azure File Shares with Snapshots

Data Management in the Cloud: Creating and Restoring Azure File Shares with Snapshots

Azure File Shares with Snapshots is a feature provided by Azure Files that allows you to take point-in-time, read-only copies of your file shares. These snapshots capture the state of the share when taken, protecting against application errors, data corruption, accidental deletions, or unintended changes.

Snapshots are handy for general backup purposes, and Azure recommends using the Azure file share backup service for managing these snapshots. This service integrates with Azure File Sync and allows for centralized management of file share data and backups, providing benefits like zero infrastructure deployment, customized retention, built-in management capabilities, instant restore, and protection against accidental deletion.

Let's get started

1- On the search bar enter the storage account

2- Create a Storage Account and File Share

3- a: Select Azure subscription and resource group
b: Give your storage account a name.
c: Set to the same location as the existing resource group
d: Set Performance to Standard
e: Click Review + Create and then Create.

4- A: Once the storage account has been deployed successfully, click Go to the resource.
B: Click on File Shares in the left side menu.

5- Click on + File Share

6- a: Give your file share a name
b: Click on Review + Create

7- Once Validation has passed click on create

8- a: Connect to your VM
b: Once connected, minimize any open windows, and click on the magnifying glass to search for Windows Firewall and open Windows Firewall.

9- Click Turn Windows Firewall on or off in the Windows Firewall window.

10- Turn the Firewall state to Off. Click Apply and then OK.

11- Search for Windows PowerShell on your Windows VM. Right-click on it, and click on Run as administrator.

12- a: Open your storage account in the Azure portal, and click File Shares on the left menu.
b: Select your file share, and click Connect.
c: In the side window that opens, click on Show Script and copy the PowerShell script to your clipboard.

13- a: Paste the PowerShell script in the Windows VM PowerShell session to connect the file share
b: After a moment, you should get a message that the credential was added successfully

Take a Snapshot and Restore Data
14- a: Click in File Explorer at the bottom of the Windows VM.
b: Click on This PC and open your file share.
c: Right-click in the fileshare window and click New > Text Document. Name this document.

15- a: Open the newly created document and type any words in there
b: Click on File > Save.

16- a: Return to the Azure Portal and close the Connect side window
b: Click on Browse in the left side menu and verify that you can see the test.txt file.

Add Snapshots
17- Click Add Snapshot and give it a name in the Comment Window before clicking OK.

18- a: Add random text to your created test document in the Windows VM. Click on File > Save.

b: Return to the Azure Portal.

19- a: Locate the Snapshot and select to open it up.

b: Select the ellipsis on the right-hand side of the test.txt file.

c: Select Restore

20- a: Click on Overwrite original file and then OK.

b: Open the test.txt file and you should see that it has reverted to its original text

I hope this step-by-step tutorial helped you understand how to create a storage account and file share in Azure, connect it to a virtual machine (VM), and manage data with snapshots. Thank you