Efficient and Secure File Sharing for Geographically Dispersed Offices with Restricted Network Access on Azure
Published: 2024-05-28 12:12:23

The company operates in multiple locations and requires an efficient method for file sharing and information dissemination across its offices. For instance, the Finance department needs reliable access to confirm cost information for auditing and compliance purposes. These file shares must be easily accessible and load quickly, with certain content restricted to selected corporate virtual networks.

Our goals are as follows:

- Create a storage account specifically for file shares.
- Configure a file share and directory.
- Set up snapshots and practice restoring files.
- Restrict access to a specific virtual network and subnet.

Create and configure a storage account for Azure Files.
Create a storage account for the finance department’s shared files. Learn more about storage accounts for Azure Files deployments.

In the portal, search for and select Storage accounts.
![select Storage accounts](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tohjmahinp4wmyxpkq21.png)
Select + Create.
![Select + Create](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v6pjv6t52e40dm7tna57.png)

For Resource group select Create new. Give your resource group a name and select OK to save your changes.
![select Create new](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/unifp0022jf68rs3fcjg.png)

Provide a Storage account name. Ensure the name meets the naming requirements.
![Storage account name](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7btz1rlconz08iawsmkj.png)

Set the Performance to Premium.
![Set the Performance to Premium](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fhmc6j1cy7rz7k627t6y.png)

Set the Premium account type to File shares.
![File shares](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6idjqs4jyaj3gpwmupka.png)

Set the Redundancy to Zone-redundant storage.
![Zone-redundant storage](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4qhl1zk59ccm1nx09fq7.png)

Select Review and then Create the storage account.
![Select Review and then Create](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2susdy52k2kphuvl62gm.png)

Wait for the resource to deploy.
Select Go to resource.
![Go to resource](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mpmlmmv6pcu1ladh5znj.png)


Create and configure a file share with directory.
Create a file share for the corporate office. Learn more about Azure File tiers.

In the storage account, in the Data storage section, select the File shares blade.
![File shares blade](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dqnk5ry78889d92yijnx.png)

Select + File share and provide a Name.

![Select + File share](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o7qj5x6u5e8d3glr4m9u.png)
![provide a Name](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ppefs4ypg1emqgm9x42j.png)

Review the other options, but take the defaults.
![Review](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uwkcvf3fouggpl9ne9jl.png)
Select Create
![Select Create](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xef62e5ool07473ew7g7.png)

Add a directory to the file share for the finance department. For future testing, upload a file.

Select your file share and select + Add directory.
![select + Add directory](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i780lym1n78cyj9lp9f4.png)

Name the new directory finance.
![new directory finance](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p9pr0735fnhx4ihqswr4.png)

Select Browse and then select the finance directory.
![Select Browse](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bfq589vh3wqfo85m94p5.png)
![finance directory.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fqksw1hn5jggnwb2m099.png)


Notice you can Add directory to further organize your file share.
Upload a file of your choosing.
![Upload a file of your choosing](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/20l5sh388e97e59n275s.png)


Configure and test snapshots.
Similar to blob storage, you need to protect against accidental deletion of files. You decide to use snapshots. 

Select your file share.
In the Operations section, select the Snapshots blade.
![Snapshots blade](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pkf48i23ewrx2odjyi2y.png)

Select + Add snapshot. The comment is optional. Select OK.
![Select + Add snapshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y8caety4rnfh8bi7d166.png)


Select your snapshot and verify your file directory and uploaded file are included.
![verify your file directory](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/85r8xq8h6tm8vdvu7ib1.png)

Practice using snapshots to restore a file.

Return to your file share.
Browse to your file directory.
![Browse to your file directory](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zsixjz1ha1z62ambwnog.png)

Locate your uploaded file and in the Properties pane select Delete. Select Yes to confirm the deletion.
![select Delete](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9yq0g66p9ya43xbtyr6z.png)

Select the Snapshots blade and then select your snapshot.
![Snapshots blade](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0edtfooqtbld4jzvj372.png)
![select your snapshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wmdcyfyozwhbosl60vlw.png)

Navigate to the file you want to restore,
![file you want to restore](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q5k9n5vhti9hp7cu67ee.png)

Select the file and the select Restore.
![select Restore](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wep3cfzqngrmpe98xcb7.png)

Provide a Restored file name.
![Restored file name](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gk4xbiihh8v68tf34zjv.png)

Verify your file directory has the restored file.
![Browse file share](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7qxj7pdo8pzym200f72x.png)
File has been restored 
![File has been restored ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cj3uzjhzro2m9rane1gs.png)


Configure restricting storage access to selected virtual networks.
This tasks in this section require a virtual network with subnet. In a production environment these resources would already be created.

Search for and select Virtual networks.
![select Virtual networks](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jm6n45dl3eso3udzwwl1.png)


Select Create. Select your resource group. and give the virtual network a name.
![Select Create](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zpx9g3koh3787370p8n5.png)
![virtual network a name](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rl95jiij1dow3u39hqup.png)

Take the defaults for other parameters, select Review + create, and then Create.
![select Review + create](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uyiqcr5gvgemzkurtx03.png)
![ Create](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uw7kpopheejr135153lg.png)

Wait for the resource to deploy.
Select Go to resource.
![Go to resource](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f3wl5k5bjji16q2lynw1.png)

In the Settings section, select the Subnets blade.
![Subnets blade](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cy0uicqual0fgfz8k78s.png)

Select the default subnet.
![default subnet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ocj06s9pxeg6mlwapq7.png)

In the Service endpoints section choose Microsoft.Storage in the Services drop-down.
![Microsoft.Storage ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e4fv0cyqvhlg41l9rrgj.png)

Do not make any other changes.
Be sure to Save your changes.
![Save your changes](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xiatgxwwsta7ynnb3nwk.png)


The storage account should only be accessed from the virtual network you just created. 

Return to your files storage account.
In the Security + networking section, select the Networking blade.
![ Networking blade.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/94kshgv6m5o2i58u1ey6.png)

Change the Public network access to Enabled from selected virtual networks and IP addresses.
![Enabled from selected virtual networks and IP addresses](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ajs4k7lbjnf9gwhnku5i.png)

In the Virtual networks section, select Add existing virtual network.
![Add existing virtual network](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j98psfaya7fjc268vhu5.png)

Select your virtual network and subnet, select Add.
![Select your virtual network and subnet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2kn4hzr1alkjjk5tkwro.png)

Be sure to Save your changes.
![Save your changes](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rzii2bmiuo1i33w01lof.png)

Select the Storage browser and navigate to your file share.
![Select the Storage browser](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jbhhz9nj9wer62o4tszo.png)


Verify the message not authorized to perform this operation. You are not connecting from the virtual network.
![Verify the message not authorized to perform this operation](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b1jt0vd02wscjbkqhic9.png)