DEV Community

Cover image for Provide private storage for internal company documents
Precious Uchechukwu Nwafor
Precious Uchechukwu Nwafor

Posted on

Provide private storage for internal company documents

A company needs storage for their offices and departments. This content is private to the company and shouldn't be shared without consent. This storage requires high availability if there is a regional outage. The company wants to use this storage to back up the public website storage.

Let's get to it!

Phase 1: Create a storage account and configure high availability.

Action plan:

1 . In the portal, search for and select Storage accounts.

Navigating the global search bar to find storage accounts

2 . Select + Create.

Initiating select + create setup

3 . Select the Resource group created in the previous lab - "sapublic". Set the Storage account name to private. Add an identifier to the name to ensure the name is unique. Select Review, and then Create the storage account.

Initiating creation

Final deployment

4 . Wait for the storage account to deploy, and then select Go to resource.

Deployment complete

5 . This storage requires high availability if there is a regional outage. Read access in the secondary region is not required. We have to configure the appropriate level of redundancy. To this, in the storage account, in the Data management section, select the Redundancy blade. Ensure Geo-redundant storage (GRS) is selected. Refresh the page. Review the primary and secondary location information. Save your changes.

Configuring Geo - redundancy

Phase 2: Create a storage container, upload a file, and restrict access to the file.

Action plan:

  1. Create a private storage container for the corporate data. In the storage account, in the Data storage section, select the Containers blade. Select + Container. Ensure the Name of the container is private. Ensure the Public access level is Private (no anonymous access). As you have time, review the Advanced settings, but take the defaults. Select Create.

Deploying a private container

2 . For testing, we will upload a file to the private container. The type of file doesn’t matter. A small image or text file is a good choice. Test to ensure the file isn’t publicly accessible. To do this, Select the container. Select Upload. Browse to files and select a file. Upload the file.

Upload test for the private container secuirity

3 . Select the uploaded file. On the Overview tab, copy the URL. Paste the URL into a new browser tab. Verify the file doesn’t display and you receive an error.

Testing Access

Access Denied

Phase 3: An external partner requires read and write access to the file for at least the next 24 hours. Configure and test a shared access signature (SAS).

Action plan:

1 . Select your uploaded blob file and move to the Generate SAS tab.

Configuring shared Access signature

2 . In the Permissions drop-down, ensure the partner has only Read permissions.
Verify the Start and expiry date/time is for the next 24 hours. Select Generate SAS token and URL.

Generating SAS

3 . Copy the Blob SAS URL to a new browser tab. Verify you can access the file. If you have uploaded an image file it will display in the browser. Other file types will be downloaded.

Testing SAS URL

Access granted: Can view image

Phase 4: Configure storage access tiers and content replication. To save on costs, after 30 days, move blobs from the hot tier to the cool tier.

Action plan:

1 . Return to the storage account **. In the **Overview section, notice the Default access tier is set to Hot.

Default access tier

2 . In the Data management section, select the Lifecycle management blade. Select Add rule.

Life cycle management deployment

3 . Set the Rule name to movetocool. Set the Rule scope to Apply rule to all blobs in the storage account. Select Next.

4 . Ensure Last modified is selected. Set More than (days ago) to 30. In the Then drop-down select Move to cool storage. As you have time, review other lifecycle options in the drop-down.Add the rule.

Automating Cost Savings

Phase 5: The public website files need to be backed up to another storage account.

Action plan:

1 . In your storage account, create a new container called backup. Use the default values.

New backup container

2 . Navigate to your publicwebsite storage account. This storage account was created in the previous exercise. In the Data management section, select the Object replication blade. Select Create replication rules.

Setting up object replication

3 . Set the Destination storage account to the private storage account.
Set the Source container to public and the Destination container to backup. Create the replication rule.

Replication rules

4 . Optionally, as you have time, upload a file to the public container. Return to the private storage account and refresh the backup container. Within a few minutes your public website file will appear in the backup folder.

Success verification

Final verification

Mission Accomplished!

Top comments (2)

Collapse
 
realcloudprojects profile image
SKILL.SCH

Nice

Collapse
 
precious_nwafor profile image
Precious Uchechukwu Nwafor

Thank you so much, Coach