What Is Azure Blob Storage

Introduction

 
Azure Blob storage is an object storage account on the cloud. You can store a massive amount of unstructured data like text, images, and videos. Blob storage is used to store binary large objects. Blob is stored in a directory structure called 'Containers'.
 

Why Use Blob Storage

  1. Blob storage is used for general purpose storage
  2. Blob is used to store unstructured data like audio, video, image, logs, and any type of media data from streaming, text, and binary data.
  3. Blob is low-cost and highly available (across multiple regions) storage.

When Not to Use Azure Blob Storage

  1. If you need to utilize this data for insightful purposes along these lines ensure this data can be empowered for parallelized examination (Azure Data Lake Gen2)
  2. You need to store social information (in this case, you should use Azure SQL Database, Azure Databases for PostgreSQL and MySQL or Azure SQL Data Warehouse)
  3. In the event that you need to perform advanced real-time querying (Azure Cosmos DB)

How to interact with Azure Blob Storage?

 
There are many services in Azure through which you can interact with Blob Storage
  1. AzCopy – a command-line interface to be downloaded locally. This tool can be used in windows and Linux to copy data to and from blob storage.
  2. Azure Data Factory- you can copy data to and from blob storage through ADF by using the account key or managed identities for Azure resources.
  3. Azure Databricks
  4. Azure SDKs (.NET, Java, Python, etc.) – allowing you to interact with Azure Storage directly within Python or R
  5. Azure Data Box Disk - It is used to transfer on-premises data to blob storage.
  6. Azure Import/Export service - It is used to import/export a large amount of data to and from your storage account using hard drives that you provide.

Resources of Blob Storage

 
There are three types of resource available in Blob storage
  1. The storage account
    This storage account allows you to create a unique namespace in azure for your data. whatever data you store in this storage has its unique account name. This account name and azure storage blob endpoint form the base address of data. See below address,

    http://Myfirstblobaccount.blob.core.windows.net

    Where 'Myfisrtblobaccount' is a storage account name and the rest are the endpoint blob address.
  1. A container in the storage account
    A storage account can have multiple containers and a container can store multiple blobs similar to a directory in a file system.
  1. A blob in the container
    There are three types of blobs in azure storage,
    • Block Blobs
      These blobs are made up of blocks of data that can store text and binary data and can be managed individually. Maximum 4.75 TiB data can be store in block blobs.

    • Append Blobs
      These blobs are made up of block blobs but are optimized for append operations.

    • Page Blobs
      The maximum size of the file that page blob store is 8 TiB. It can store random access files, VHD files (virtual hard disk) and provide them as disks for Azure virtual machines.
Work with Blob
 
There are many ways to work with Blob in azure.
  1. Azure Portal
  2. Azure storage explorer
  3. PowerShell Script

Azure Portal

 
You can connect your blobs through the Azure portal. Login on Portal.azure.com. To work with blob you must have a storage account. to see, how to create a storage account you can check my previous article
Now, you need to create a 'container'. To do so, go to your storage account and open it. Now scroll down and go to the Blob service section. Here you will get the 'Container' option. Click on it. Now to create a new container, click on '+ Container' and create.
 
What Is Azure Blob Storage
 
What Is Azure Blob Storage
 
What Is Azure Blob Storage
 
What Is Azure Blob Storage 
 
Once your container has been created go to the container and click on the upload button to upload the blob. Browse the file and select an advanced setting and then click on upload.
 
What Is Azure Blob Storage 
 
You can easily download and delete the block blobs from the container by selecting the check box and click on delete to check how to delete blob using Powershell script, see below link

Azure Storage Explorer

 
Storage Explorer is software that you can install on your machine. Login here with your Azure credentials. Now you are able to see all your storage accounts here. double click on your storage account and you will be able to see the containers, file shares, Queue, and tables, etc.
 
What Is Azure Blob Storage 
 
Right-click on 'Blob Container' to create a new container.
 
What Is Azure Blob Storage 
 
once you open the container you will get the option to upload and download the files.
 
What Is Azure Blob Storage 
 

Using PowerShell

 
Another way to work with blob is the PowerShell script. you can write a PowerShell script to connect with an azure account and create a resource group, storage account, container, etc.
 
PowerShell Script be like,
  1. #connect with azure account  
  2. Connect-AzAccount  
  3. #get location  
  4. Get-AzLocation | select Location  
  5. $location = "eastus"  
  6. #create resource group  
  7. $resourceGroup = "myResourceGroup"  
  8. New-AzResourceGroup -Name $resourceGroup -Location $location  
  9. #create storage account  
  10. $storageAccount = New-AzStorageAccount -ResourceGroupName $resourceGroup `  
  11.   -Name "mystorageaccount" `  
  12.   -SkuName Standard_LRS `  
  13.   -Location $location `  
  14. $ctx = $storageAccount.Context  
  15. #create container  
  16. $containerName = "quickstartblobs"  
  17. New-AzStorageContainer -Name $containerName -Context $ctx -Permission blob  
  18. # upload a file to the default account (inferred) access tier  
  19. Set-AzStorageBlobContent -File "D:\_TestImages\Image000.jpg" `  
  20.   -Container $containerName `  
  21.   -Blob "Image001.jpg" `  
  22.   -Context $ctx   
  23.  
  24. # upload a file to the Hot access tier  
  25. Set-AzStorageBlobContent -File "D:\_TestImages\Image001.jpg" `  
  26.   -Container $containerName `  
  27.   -Blob "Image001.jpg" `  
  28.   -Context $ctx   
  29.   -StandardBlobTier Hot  
  30.  
  31. # upload another file to the Cool access tier  
  32. Set-AzStorageBlobContent -File "D:\_TestImages\Image002.png" `  
  33.   -Container $containerName `  
  34.   -Blob "Image002.png" `  
  35.   -Context $ctx  
  36.   -StandardBlobTier Cool  
  37.  
  38. # upload a file to a folder to the Archive access tier  
  39. Set-AzStorageBlobContent -File "D:\_TestImages\foldername\Image003.jpg" `  
  40.   -Container $containerName `  
  41.   -Blob "Foldername/Image003.jpg" `  
  42.   -Context $ctx   
  43.   -StandardBlobTier Archive  

Azure Blob Storage Pricing

 
As Azure is paid service so, when you use Blob storage, you need to pay for it. The cost breakdown for storage, data operations and data transfer. The costs of services depend of below factors,
  1. Region and accessibility zone of storage
  2. Amount of data stored
  3. Storage level (Premium, hot, cool, archive)
  4. Redundancy level (LRS, ZRS, GRS)
  5. Reserved storage (pay-per-use, 1 year, 3 years)
  6. Operations performed on the data
  7. Data Transfer volumes

Redundancy Options

 
Azure Blob Storage has five type of redundancy
  • Locally Redundant storage (LRS) - provides 11 9’s (at least 99.999999999%) of durability and keeping multiple copies of data in one Azure datacenter.
  • Zone-Redundant Storage (ZRS) - provides 12 9’s (at least 99.9999999999%) of durability and replicates data across multiple Availability Zones (AZ) in one region.
  • Geo-Redundant Storage (GRS) - provides 16 9’s (at least 99.9999999999999%)of durability and data is stored in a one region and asynchronously replicating to secondary region.
  • Read Access Geo-Redundant Storage (RA-GRS) - provides 16 9’s (at least 99.9999999999999%)of durability and replicates data to a secondary zone.
  • Geo-zone redundant storage (GZRS) - combination of ZRS with GRS. Data is replicated across multiple availability zones in both first and second region. This option is only available in GPv2 storage accounts.
  • Read-access geo-zone-redundant storage (RA-GZRS) - like GZRS but enables read access from either replicated region. This option is only available in GPv2 storage accounts.

Redundancy wise storage cost in Azure Blob Storage

 
Below are the prices for West US 2.
 
LRS Redundancy
 
Premium Tier
Hot Tier
Cool Tier
Archive Tier
 $0.15 / GB
$0.0184 / GB (first 50TB)
$0.0177 / GB (51-500 TB)
$0.0170 / GB (500+ TB)
 $0.01 / GB
$0.00099 / GB
 
ZRS Redundancy
 
Premium Tier
Hot Tier
Cool Tier
Archive Tier
N/A
$0.023 / GB (first 50TB)
$0.0221 / GB (51-500 TB)
$0.0212 / GB (500+ TB)
 $0.0125 / GB
N/A
 
GRS Redundancy
 
Premium Tier
Hot Tier
Cool Tier
Archive Tier
N/A
$0.0368 / GB (first 50TB)
$0.0354 / GB (51-500 TB)
$0.0339 / GB (500+ TB)
$0.02 / GB
$0.00299 / GB
 

Redundancy wise Reserved Storage

 
The pricing shown is for reserving 100TB per month.
 
LRS Redundancy
 
1-YEAR RESERVED
3-YEAR RESERVED
Hot
Cool
Archive
Hot
Cool
Archive
$11,545
$840
$91
$1,244
$676
$84
 
ZRS Redundancy
 
1-YEAR RESERVED
3-YEAR RESERVED
Hot
Cool
Archive
Hot
Cool
Archive
$1,932
$1,050
N/A
$1,555
$845
N/A
 
GRS Redundancy
 
1-YEAR RESERVED
3-YEAR RESERVED
Hot
Cool
Archive
Hot
Cool
Archive
$3,090
$1,680
$273
$2,488
$1,352
$252
 

Data Transfer Cost

 
Below table shows the data transfer cost of blob storage
 
LRS Redundancy
 
DATA RETRIEVAL (per GB)
DATA WRITE (per GB)
Hot
Cool
Archive
Hot
Cool
Archive
Free
$0.01
$0.02
Free
Free
Free
 
ZRS Redundancy
 
DATA RETRIEVAL (per GB)
DATA WRITE (per GB)
Hot
Cool
Archive
Hot
Cool
Archive
N/A
$0.01
N/A
N/A
N/A
N/A
 
GRS Redundancy
 
 DATA RETRIEVAL (per GB)
DATA WRITE (per GB)
Hot
Cool
Archive
Hot
Cool
Archive
Free
$0.01
$0.02
Free
$0.005
N/A