File shares with limited access (corporate virtual networks) - Azure Files and Azure Blobs
Tags: virtualmachine, virtualnetwork, access, azure
Published: 2024-05-26 00:31:21

### Create and configure a storage account for Azure Files.
**Create a storage account for the finance department’s shared files.**
In the portal, **search for and select Storage accounts**.
![search for and select Storage accounts](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fzpgl80t63301ks6nf0f.png)
**Select + Create.**
![Select + Create.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8e0bw1fj0xy508x926u8.png)
**For Resource group select Create new**. _Give your resource group a name and select OK to save your changes._

![Resources grp](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/27fpg3t6y6rq553njted.png)

**Provide a Storage account name. Ensure the name meets the naming requirements.**
**Set the Performance to Premium.**
**Set the Premium account type to File shares.**
**Set the Redundancy to Zone-redundant storage.**

![Set up](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yorg9s1qkmugrn0i8ptl.png)
**Select Review and then Create the storage account.**
![Review](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w4p48gp8dm717umgse2u.png)
**Wait for the resource to deploy.**

![Deployment](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w41kjcor9pf47nd39k0b.png)


**Select Go to resource.**

![Resource](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b7qt2pqhjjw38ctlloh3.png)

### Create and configure a file share with directory.
**Create a file share for the corporate office.**
**In the storage account, in the Data storage section, select the File shares blade.**
![File Share](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6xwbq0e6tyzxzhck0rby.png)
**Select + File share and provide a Name.**

![File Name](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oxnperyh8efzm6gsipn3.png)
**Review the other options, but take the defaults.**

![Review](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zro2mbqyep3ogza90f37.png)


**Select Create**

![fine](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yxx3clbfxyqor99ctg48.png)

**Add a directory to the file share for the finance department.** _For future testing, upload a file._

![testing file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yhvbpsntvgnq5z1ldupd.png)

![file uploaded](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jzndvbujp4jmaowam4wb.png)


**Select your file share and select + Add directory.**
**Name the new directory finance**.
![directory](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xa2uiyirj7karhnsmmpj.png)
**Select Browse and then select the finance directory.
Notice you can Add directory to further organize your file share.**

![confirmation of directory](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dan46qhrj1wnymf2rke9.png)

**Upload a file of your choosing.**

![upload to finance](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7cfgznqbba5v63fxh5t0.png)

![upload to finance](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kusu1cfiys7exyj8grbu.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.**
**Select + Add snapshot.** _The comment is optional._ 
**Select OK.**
![Snapshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hzyajoesvlnutfhi0u6k.png)

![Actual Snapshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ya4ohm7qcbdncoyetqpt.png)

**Select your snapshot and verify your file directory and uploaded file are included.**

![Snap](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m41fcoadkc6xpc1g3u7m.png)

_Practice using snapshots to restore a file._

**Return to your file share.**
**Browse to your file directory.**

![file dir](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/obb00mqg75d4r6aun9pr.png)

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

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

![Snap restore](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vadcea3l8hurdjzs5dmu.png)


**Select the Snapshots blade and then select your snapshot.
Navigate to the file you want to restore**
![restore](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2k5zeeeqapxbuzjsicmo.png)

**Select the file and the select Restore.
Provide a Restored file name.**

![file restored](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fehcmsyqd0iq8b7um12f.png)

**Verify your file directory has the restored file.**

![restoration confirmed](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p0px1qdmkeqy8l0naf4g.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.**
![Virtual network](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/17ksqustmgj262sjlgsb.png)
**Select Create. Select your resource group. and give the virtual network a name.**
![Virtual network](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mdser8b8pyue5w9ju9te.png)


![Virtual net name](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/to6k68h7p5vsfucbbzze.png)
**Take the defaults for other parameters, select Review + create, and then Create.**
![Create Virtual Network](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dkdjqku29ioca9xvd6vd.png)
**Wait for the resource to deploy.
Select Go to resource.**

![Go to resource](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/77pt2mez2wv03laiyx0e.png)
**In the Settings section, select the Subnets blade.**
**Select the default subnet.**
![default](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gr1a0j6d54bsy477x3un.png)
**In the Settings section, select the Subnets blade.**
**Select the default subnet.**
_In the Service endpoints section choose **Microsoft.Storage** in the Services drop-down._
**Do not make any other changes.**
**Be sure to Save your changes.**
![Service Endpoint](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j1oyyd8cd114hpne9fdm.png)
_The storage account should only be accessed from the virtual network you just created. Learn more about using private storage endpoints.._

**Return to your files storage account.**
**In the Security + networking section, select the Networking blade.
Change the Public network access to Enabled from selected virtual networks and IP addresses.**
**In the Virtual networks section, select Add existing virtual network.
Select your virtual network and subnet, select Add.**

![Configure security and network](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b0s4a2nslv1g5e1pdc1o.png)
**Be sure to Save your changes.**
![save and confirm security + network](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e7c69wdulk3iq0i34q9f.png)