Creating Shared File Storage in Microsoft Azure
Tags: azure, microsoft, cloud, cloudstorage
Published: 2024-07-04 22:26:46

In this guide, we will walk through the steps to create a shared storage account in Microsoft Azure. We'll cover creating a storage account, setting up a file share, managing snapshots, and restricting access to selected virtual networks.

## Creating a Storage Account

1. **Create a Storage Account:**
   - Create a Resource Group for your storage and assign it a name.
   - Choose Performance as Premium and set the account type to File Shares.
   - Set Redundancy to Zone-Redundant storage.
   - Create the resource and navigate to it.

    ![Configuring Storage Account](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/buinfsv9j1tnmoqb0lwb.jpg)

2. **Setting up File Shares:**
   - In the Data Storage section, select File Shares.
    ![Locating File Shares](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xop03yogwg2feifb8b5i.jpg)
   - Click on +File Share and create a name for the file share.
    ![Adding a File Share](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/47lpklftt2isink2icid.jpg)
   - Leave other settings as default and click Review+Create, then click Create.
    ![Creating the File Share](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0mucfq6f8gmxjvvuv41i.jpg)

3. **Adding a Directory:**
   - Click on +Add Directory and give your directory a name.
    ![Adding a directory](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7tzhfhwt6c2qgvp8hm5h.jpg)
   - Navigate to your newly created directory and upload a file of your choice.

    ![Navigating to new Directory](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b9cmeo18lsz8kpworq6y.jpg)

    ![Uploading file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aiq18xfmohj8g01jk0ss.jpg)

4. **Configuring and Testing Snapshots:**
   - Go back to your File Share, select Operations, and click Snapshots.

    ![Locating snapshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wlupnjygq4i8m9hf5fjs.jpg)
   - Click +Add Snapshot, optionally add a comment, and confirm.

    ![Adding snapshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/plpteucg23osee9se8xw.jpg)
   - Ensure your directory is included in the snapshot.

    ![Looking at directory](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/61gz4xxbgkirwcyyx0bi.jpg)
   - Test the snapshot functionality by deleting the uploaded file, then restore it from the snapshot.

5. **Restricting Storage Access to Virtual Networks:**
   - Create a Virtual Network:
     - Search for "Virtual Network" and create a new one with default settings.

    ![Locating Virtual Network](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ft3c4aw5hys9gv93dta5.jpg)

    ![Configuring a Virtual Network](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aog7sh7dna6eznvaksf7.jpg)
     - Navigate to the subnet settings, select the default subnet, and enable "Microsoft.Storage" under Service Endpoints.

    ![Locating Subnets](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/12vfhs8dyhhzfv45st0s.jpg)

    ![Clicking the default subnet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tcgbm0bnw1wljawmb8bg.jpg)

    ![Choosing the service endpoint](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j1t8zh32nwjpogkhm2it.jpg)

6. **Configure Network Access for the Storage Account:**
   - Return to your File Storage account.
   - In the Security+Networking section, click on Networking.

    ![Find networking](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q3ihx5cad3zngmzi2s82.jpg)
   - Enable access from selected virtual networks and IP addresses.
   - Add the virtual network you created earlier and select the default subnet.
   - Save the settings.
    ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4c8w3qppv75zmr1xiivw.jpg)

7. **Verification:**
   - Navigate back to your File Share and ensure access is restricted to the specified virtual network.

    ![Restricted Access](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sxfmclt97vbb8689bx9f.jpg)

## Cleanup

Remember to delete all resources created during this process to avoid unnecessary charges.

By following these steps, you have successfully created a File Share, configured snapshots for your files, and restricted access to a virtual network.