Azure Storage — Uploading files in Storage

Amir Mustafa
6 min readNov 13, 2022

--

→ In this article we will be storing files in Azure Storage.

→ In the previous article we created a storage account.

→ Today, let us learn how we can upload files here. Click on the storage account. It should be showing on the homepage after creation.

→ There are four types of Data storage.

→ These storage contains completely separate data:

a. Containers: This contains Blob storage (i.e. binary files eg. PDF, Excel files, etc.)

b. File storage: Contains multiple types of other files

c. Queues:

i. This is like a messaging service.

ii. One application can place a message/data in the queue and another application comes and reads the queue.

d. Tables: Here we can keep non-relational data. Pricing is also very less.

→ In this article we will use Containers:

Uploading Files in Containers:

→ Let us create our first Azure Storage Containers. Click Containers from the left.

→ Click on + Container button.

→ We have to give the container a name. eg. container-13-nov-2022

→ Containers have multiple types of access security:

Private: By private we mean — only a specific person can access

Anonymous: Anyone with a Security Key can access

→ Let us select Private for now and click Create button.

→ Our container is successfully created. Click on the container.

→ Now we will upload files. Click the newly created container.

→ Click on the Upload button

→ Click on file explorer — we can select multiple files.

→ From the dropdown arrow of Advanced. We have multiple options:

→ When we created this Storage, we specified the Hot tier (i.e. using data regularly). Let us change to Cold Tier (as the pricing of this tier is low)

→ Here we can also see Archive Tier. This was not available at the time of storage creation.

→ Keeping every other setting as default, let us click the Upload button.

Accessing uploaded Files

→ To access the file (say image 1 as an example), click on the file to read.

→ Copy the URL and open it in a browser.

ERROR — Access Issue

→ We get an error. This error comes because of access issues.

→ If you have worked in the Amazon Cloud platform. This error is something similar to the S3 bucket reading URL access error.

→ Let us provide access for getting a Fully Qualified URL.

→ Click on the three dots of the file

→ Click Generate SAH (i.e. Shared Access Token)

→ Finally click Generate Shared Access Token URL button.

→ Let us now copy the generated URL and open it in the browser.

→ We now can read the image. The same will go to the other files of the container.

Image — Successfully opened

→ So we have successfully read the file with the help of the Shared Access key 😀

Some Other Features:

→ There are many configurations provided by the Microsoft team.

→ Let us see some of them:

a. Configuring Redundancy:

→ If we click Redundancy, we can configure multiple copies of this storage in other geographic regions.

b. Life Cycle Management:

→ We can configure our files based on the time period. i.e. move files to the archive tier, delete files in 30 days, etc.

→ Click Life cycle management from the left explorer. Click Add a rule.

→ Enter the rule name

eg. Rule 1 — delete in 30 days. Click the Next button.

→ Based on the action we are trying to do we select eg. Delete for this rule. Click Add button.

→ Azure finally configures this rule for this storage (i.e. storageamir )

Closing Thoughts:

In this article, we have uploaded files in Azure Container Storage and provided Shared Access for reading the file.

We have also seen some features provided for Azure storage i.e. Redundancy, Lifecycle methods.

Thank you for reading till the end 🙌 . If you enjoyed this article or learned something new, support me by clicking the share button below to reach more people and/or give me a follow on Twitter and subscribe Happy Learnings !! to see some other tips, articles, and things I learn about and share there.

--

--

Amir Mustafa
Amir Mustafa

Written by Amir Mustafa

JavaScript Specialist | Consultant | YouTuber 🎬. | AWS ☁️ | Docker 🐳 | Digital Nomad | Human. Connect with me on https://www.linkedin.com/in/amirmustafa1/

No responses yet