DEV Community

Cover image for Creating a storage account for private documents in Azure.
John Essien
John Essien

Posted on

Creating a storage account for private documents in Azure.

Dearest readers, did you enjoy the last article? Can you tell if this article will be informative as well as fascinating by just reading the caption? In this week's article, here is a taster to what we would be doing.

  • Create a storage account for the company private documents.
  • Configure redundancy for the storage account.
  • Configure a shared access signature so partners have restricted access to a file.
  • Back up the public website storage.
  • Implement lifecycle management to move content to the cool tier.

Oh! lest I forget, this article is a follow up from the last article. Without further ado, lets go to the clouds!!!


Create a storage account and configure high availability.

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

Search and Select

  • Select + Create.

+ Create

  • Select the Resource group created in the previous session. Set the Storage account name to private. Select Review, and then Create the storage account.

Renaming

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

Go to resource

This storage requires high availability if there’s a regional outage.

  • In the storage account, in the Data management section, select the Redundancy blade. Ensure Geo-redundant storage (GRS) is selected. Save your changes.

Redundancy

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

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.

New container

For testing, upload a file to the private container

  • Select the container, select Upload. Browse to files and select a file and Upload the file.

Uploading

  • Select the uploaded file and on the overview tab, copy the URL.

copy url

  • Paste the URL into a new browser tab and verify the file doesn’t display and you receive an error.

error displaying

Configure and test a shared access signature (SAS).

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

Generate sas

  • In the Permissions drop-down, ensure the partner has only Read permissions.

permission

  • Verify the Start and expiry date/time is for the next 24 hours and Select Generate SAS token and URL
    time verification

  • On the Overview tab, Copy the Blob SAS URL to a new browser tab.

Blob SAS url

  • Verify you can access the file. If you have uploaded an image file it will display in the browser

Uploaded Image

Configure storage access tiers and content replication.

To save on costs, after 30 days, move blobs from the hot tier to the cool tier.

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

Storage Overview

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

  • Set the rule name to movetocool. Set the rule scope to apply rule to all blobs in the storage account and select next.

Rule name

  • Ensure Last modified is selected and set to more than (days ago) to 30.

more than 30days

  • In the drop-down select Move to cool storage. As you have time, review other lifecycle options in the drop-down. Add the rule.

Select rule

The public website files need to be backed up to another storage account

  • In your storage account, create a new container called backup. Navigate to your publicwebsite storage account. This storage account was created in the previous article.

 Storage Backup

  • In the Data management section, select the Object replication blade. Select Create replication rules.

Create replication rule

  • Set the Source container to public and the Destination container to backup. Create the replication rule.

setting containers

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.

Testing

Testing 2


That was awesome and intense!!! We are really building some cloud muscle. Practice! Practice! Practice! And I will see you in the next article!!

COMMENT, LIKE AND SHARE

Top comments (0)