DEV Community

Cover image for HOW TO CREATE A STORAGE ACCOUNT, UPLOAD A FILE AND CONTENT REPLICATION.
ANDREW ARIGU AYUBA
ANDREW ARIGU AYUBA

Posted on

HOW TO CREATE A STORAGE ACCOUNT, UPLOAD A FILE AND CONTENT REPLICATION.

A storage account in Microsoft Azure is a fundamental resource that provides a unique namespace to store and access data in the Azure cloud. It can be set to public or private and supports various blob types. It acts as a container for various types of data services offered by Azure Blob Storage, File Storage, Queue Storage, and Table Storage. Each storage account is associated with a subscription and has a globally unique name, which forms part of the endpoint URLs used to access the stored data.

STEPS TO CREATING STORAGE ACCOUNT.

STEP 1: Log into your azure account, search and click on storage account in the search bar.

Image description

STEP 2: Click on + create to create a storage account.

Image description

STEP 3: Choose resource group if one is available or create new one, enter the storage account name and leave other parameters as default depending on what is requested.

Image description
Select Review + create and then Create the storage account.

STEP 4: Click create and wait for the storage account to deploy, and then select Go to resource.

Image description
From here we have created a storage account, let us Create a storage container, upload a file, and restrict access to the file.

STEP 5: In the storage account, in the Data storage section, select the Containers blade.

Image description

STEP 6: Select + Container, Name the container any name of your choice. Ensure the Public access level is private (no anonymous access)and select Create.

Image description

STEP 7: To upload a file, click on the container created. Select Upload, Browse to files and select a file. Upload the file.

Image description

STEP 8: Select the uploaded file and on the overview tab, copy the URL.

Image description

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

Image description

Configure and test a shared access signature (SAS).

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

Image description

Verify the Start and expiry date/time is for the next 24 hours and Select Generate SAS token and URL. Ensure the partner has only Read permissions.

Image description

On the Overview tab, Copy the Blob SAS URL to a new browser tab. Verify you can access the file.

Image description

Image description

STEP 9: In the storage account, navigate to data management section and select the Lifecycle management.

Image description

STEP 10: Select + Add rule, set the rule name, set the Rule scope to Apply rule to all blobs in the storage account and Select Next.

Image description

STEP 11: Ensure last modified is selected, set more than (days ago) to 30 in the Then drop-down, select Move to cool storage and click add.

Image description

Now we need to create a content replication. Content replication is a core feature of Azure Storage Accounts that ensures your data is copied and maintained in different physical locations to protect against hardware failures, outages, or disasters. It’s a built-in mechanism to enhance redundancy and reliability.

STEP 12: In the Data management section, select the Object replication blade. Select Create replication rules

Image description

STEP 13: Set the Destination storage account to the new storage account. Set the Source container to the first storage account and the Destination container to the new container in the new storage account and click Create.
After clicking the create button, it will load for a while and what you uploaded on your source account will drop on your new destination account.
In summary, you have just created a storage container, uploaded a file and restricted access to the file. BRAVO!!!

DON'T FORGET TO LIKE, SHARE AND COMMENT.

Top comments (0)