[2024 Updated] Full Guide Azure Blob Storage with Examples
Tags: azure, cloudcomputing, programming, python
Published: 2024-02-13 11:36:05

---
title: [2024 Updated] Full Guide Azure Blob Storage with Examples
published: true
date: 2023-12-12 17:24:21 UTC
tags: Azure,CloudComputing,Programming,Python
canonical_url: 
---

Hello Everyone! In this article, we are going to talk about blob storage and the different types of blog storage offered by Azure Cloud.

Blob Storage is one of the most popularly used storage, It can save up to 500 TB, yes you heard it right **up to “500 TB”**. **A single file in a blob storage can be up to “4 TB”**. It also has a very high read and write speed.

To create blob storage you need to create a Storage account in Azure.  
Don’t know how to create a storage account? Don’t worry Click the below link to learn [How to Create a storage account in Azure.](https://learn.microsoft.com/en-us/azure/storage/common/storage-account-create)

## What is Blob Storage in Azure?

Blob Storage is one of the storage types provided by different cloud providers, It is used for storing unstructured data such as Images, audio, videos, etc. Whatever file we upload in the blob storage we refer to it as a blob and every blob has its unique URL; with this URL we can access it.

Blog Storages has something known as containers it’s kinda like a folder hierarchy.

### Why Azure Blog Storage is so Fast?

Whenever we upload a file in blob storage, blob treats it as a binary file. It doesn’t treat video or image files differently, for the blob all files are binary files.

Now you will think what happens if I upload a video will it become unplayable?  
Nope! It does not work like that, Let’s say you requested your video file via a website, the blob will give it to you and then your browser will play it for you.

## Hot, Cool, and Archive Azure Blob Storage

Depending on the Access there are 3 Types of Blob Storage which are Hot, Cool, and Archive.

Note: There is one more type – Premium which is similar to HOT but it’s more faster and reliable than the Hot tier 

![Different Types of Access Tier in Blob Storage](https://pratikpathak.com/wp-content/uploads/2023/12/image-1.png)

Hot Storage is most Widely used. It is used for the data that we frequently access, While in the cool we save those data which we use some time, and in the Archive we save those data which we rarely use.

Now you will think what is the **purpose of Archive Storage**?  
The answer is pretty simple. We all have some data that we never needed but still we need to save it for example log files, in case something happens so we can retrieve it. The pricing of all these 3 tiers is completely different.

![Azure Blob Storage with Examples](https://pratikpathak.com/wp-content/uploads/2023/12/Premium-2-1024x384.gif)<button type="button" aria-haspopup="dialog" aria-label="Enlarge image: Azure Blob Storage with Examples" data-wp-on--click="actions.core.image.showLightbox" data-wp-style--right="context.core.image.imageButtonRight" data-wp-style--top="context.core.image.imageButtonTop">
			<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="none" viewbox="0 0 12 12">
				<path fill="#fff" d="M2 0a2 2 0 0 0-2 2v2h1.5V2a.5.5 0 0 1 .5-.5h2V0H2Zm2 10.5H2a.5.5 0 0 1-.5-.5V8H0v2a2 2 0 0 0 2 2h2v-1.5ZM8 12v-1.5h2a.5.5 0 0 0 .5-.5V8H12v2a2 2 0 0 1-2 2H8Zm2-12a2 2 0 0 1 2 2v2h-1.5V2a.5.5 0 0 0-.5-.5H8V0h2Z"></path>
			</svg>
		</button>
_Pricing of different blob access tier_

<button type="button" aria-label="Close" style="fill: #000" data-wp-on--click="actions.core.image.hideLightbox">
                    <svg xmlns="http://www.w3.org/2000/svg" viewbox="0 0 24 24" width="20" height="20" aria-hidden="true" focusable="false"><path d="M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"></path></svg>
                </button>

![Azure Blob Storage with Examples](https://pratikpathak.com/full-guide-azure-blob-storage-with-examples/)
_Pricing of different blob access tier_

![Azure Blob Storage with Examples](https://pratikpathak.com/full-guide-azure-blob-storage-with-examples/)
_Pricing of different blob access tier_

HOT costs around $0.0184/GB while COOL costs $0.0100/GB which is around 50% cheaper and the ARCHIVE costs $0.00099/GB which is even cheaper. But there is one problem. If the data is stored in Archive then it will take around 18 hours just to read it.

As we know there are different types of buckets and each has different kinds of pros and cons. The biggest con of Blob storage is read speed, The read speed of Blob storage is

> Hot > Cool> Archive

How to change the Azure blob tier? wanna learn how to change the blob tier?  
[click here to learn how to change the Azure blob tier](https://learn.microsoft.com/en-us/azure/storage/blobs/access-tiers-online-manage?tabs=azure-portal). Azure Blob Storage with Examples

## Why use Blob Storage?

- Highly Scalable
- Blob Snapshot
- Blob Versioning
- Cheaper

## Azure Blob Storage Life Cycle Management

Let’s say you have 100 files in Hot Blob storage but not all the files are frequently accessed in this scenario you are paying for those files the same as Hot Blob, what if some settings automatically change tiers of these blobs when they are not access?  
Yes! This is possible by using Azure Blob Storage Life Cycle Management Policies. **Azure Blob Storage Life Cycle Management will automatically convert the tier of blobs** or even **delete them when they are not accessed**.

## Things to remember about Azure Blob Storage Life Cycle Management Policies:

- Auto Transition Policy – changing tiers of blobs, from hot to cool and vice versa
- Auto Blobs – You can transition Blobs, versions, and snapshot
- Auto Deletion Policy – Automatic rules to delete blobs
- Auto Rules Policy – Rules can be applied to the storage account level of a subset of blobs

## How to Apply LifeCycle Management Rules?

<iframe loading="lazy" title="How to configure azure storage lifecycle management" width="706" height="397" src="https://www.youtube.com/embed/k74ZM-tSNxo?start=12&amp;feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>

## Azure Archive Blob Storage Rehydration Policy:

When a file is uploaded in Archive Blob storage it takes up to 24 hours just to access. This is called the Rehydration Policy.

While Rehydrating a blob Azure asks you to set Priority. **Azure offers two types of Rehydration Priority viz. Standard Priority and High Priority.**

If you set priority to **“High Priority” it will rehydrate the blob in an Hour up to 10GB of file.** While standard priority takes around 16 hours.

## How to Access the Azure Blob –

On the Azure cloud there are different types of users like developers, auditors, viewers, Applications, etc based on the requirements there are different types of access methods available.

You can also use Azure Portal to access the blob storage but it has very limited functionality. 

![Azure Storage Account Authorization Methods](https://pratikpathak.com/wp-content/uploads/2023/12/Azure-Storage-Account-Authorization-Methods-1024x576.jpg)
_Azure Storage Account Authorization Methods_

### 1. Active Directory Access Azure Blob Storage

This method is for the users who are in your active directory. Firstly you need to add the user to your active directory and then you have to assign storage access using “Identity and Access Management” to that user then you can access the data.

To access the data using the Azure active directory the best and easiest method will be to use “[Azure Storage Explorer](https://azure.microsoft.com/en-us/products/storage/storage-explorer/)“.

How to use Azure Storage Explorer?  
Learn from here: [https://www.youtube.com/watch?v=GJYAgi5eYYE](https://www.youtube.com/watch?v=GJYAgi5eYYE)

### 2. Access Keys Azure Blob Storage

This method is mostly used by developers to connect the application with storage. You can also use the “[Azure Storage Explorer](https://azure.microsoft.com/en-us/products/storage/storage-explorer/)” application to connect it using Access Keys.

You will have two keys, Why there are two keys?  
you can use either of the keys. This is done for security purposes, if you want to change the keys, set your application to a secondary key, rotate your primary key, set your application to a primary key, and finally rotate your second key.

Learn: Connect to Azure Blob Storage using Python

### 3. Shared Access Keys Azure Blob Storage

Shared Access Keys are the easiest way to give temporary access to people who do not belong to your organization or to give limited/time-specific access. It is also known as Azure blob storage anonymous access.

![Screenshot 2023 12 12 224520](https://pratikpathak.com/wp-content/uploads/2023/12/Screenshot-2023-12-12-224520.jpg)

It is just a long key and by using this key you can control the access and also apply restrictions to the users who are using this Access key.

You can apply the Shared Access Key to the Storage level as well as the Blob level. If you apply it on the storage level then all the data inside the storage account will be accessible

Note: You can use the access policy to control the access at a granular level

## Azure Blob Versioning vs Azure Blob Snapshot

Both Blob Versioning and Blob Snapshot are used to save files at a particular savepoint. But there is one major difference

### Azure Blob Versioning:

Blob Versioning is used to create versions of a file, it’s like GIT, whenever there is a modification in data it will save it as a new version. You can easily switch between any version. Versions creation is automatically done in the background. By default Blob Versioning is disabled.

How to Create Blob Versioning?  
[Click here to learn more](https://learn.microsoft.com/en-us/azure/storage/blobs/versioning-enable?tabs=portal)

### Azure Blob Snapshot:

Azure Blob Snapshot is used to create a snapshot of a particular file at a particular time. it is not automatic you need to do a snapshot manually.

How to Create Blob Snapshot?  
[Click here to learn more](https://learn.microsoft.com/en-us/azure/storage/blobs/snapshots-overview)

### What is the difference between Azure Blob Version and Azure Blob Snapshot?

the working of both is quite similar, it depends on use cases. Creating a version on each modification will take up a lot of space and also some files we don’t need to track. Cases like where we need to create a recovery point before making any major changes. In such scenarios, we use Blob Snapshot in place of Blob versioning.