Azure Blob Storage - Complete Guide

What is Azure Blob Storage?

Azure Blob Storage is a **cloud-based object storage solution** designed for storing large amounts of **unstructured data**, such as images, videos, backups, and logs.

Why Use Azure Blob Storage?

  • Scalability: Stores petabytes of data without performance degradation.
  • Cost-Effective: Various storage tiers for cost savings.
  • Secure: Supports encryption and access control.
  • Highly Available: Redundancy options (LRS, GRS, ZRS) ensure uptime.
  • Access Anywhere: REST APIs enable global access.

Types of Blob Storage

  • Block Blob: Stores documents, images, and videos.
  • Append Blob: Optimized for logging (write-only operations).
  • Page Blob: Used for virtual hard disks (VHDs) in Azure VMs.

Setting Up Azure Blob Storage

Step 1: Create a Storage Account

az storage account create --name myblobstorage --resource-group MyResourceGroup --location eastus --sku Standard_LRS

Step 2: Create a Blob Container

az storage container create --name mycontainer --account-name myblobstorage

Uploading and Downloading Blobs

Step 1: Upload a File

az storage blob upload --account-name myblobstorage --container-name mycontainer --name myfile.txt --file ./myfile.txt

Step 2: List Blobs

az storage blob list --account-name myblobstorage --container-name mycontainer --output table

Step 3: Download a Blob

az storage blob download --account-name myblobstorage --container-name mycontainer --name myfile.txt --file ./downloaded.txt

Generating a Shared Access Signature (SAS)

A **Shared Access Signature (SAS)** provides temporary, secure access to blobs.

az storage blob generate-sas --account-name myblobstorage --container-name mycontainer --name myfile.txt --permissions r --expiry 2025-12-31T23:59:59Z --output tsv

Setting Up Lifecycle Management

Automatically move old files to **cool** or **archive** tiers.

az storage account management-policy create --account-name myblobstorage --resource-group MyResourceGroup --policy @policy.json

Deleting a Blob

az storage blob delete --account-name myblobstorage --container-name mycontainer --name myfile.txt

Conclusion

Azure Blob Storage is an **essential cloud storage solution** for handling **large-scale unstructured data**. It provides **scalability, security, and global access**.

📌 Next Topic: Azure SQL Database - Fully Managed Database