Azure Storage Blob Concepts

This article introduces the core concepts of Azure Blob Storage. Blob storage is Azure's massively scalable object store for the cloud. It's optimized for storing massive amounts of unstructured data, such as text or binary data. Anything that can be stored as text or binary can be stored in Blob Storage.

What is Azure Blob Storage?

Blob storage is designed for:

Key Concepts

Storage Account

A storage account provides a unique namespace in Azure for your data. Every object that you store in Azure Storage is referenced by an account name. A storage account contains all your Azure Storage data objects:

The name of your storage account must be unique across all of Azure. A storage account has the following options for availability, disaster recovery, and consistency:

Container

A container is a logical grouping of blobs. You must create a container before you can upload blobs to it. A storage account can contain an unlimited number of containers. A container can hold an unlimited number of blobs.

Container names follow specific naming rules:

Blob

A blob is the most optimized type of managed object storage for the cloud. A blob can hold:

There are three types of blobs:

  1. Block blobs: Optimized for large amounts of unstructured data. Block blobs are made up of blocks of data that can be managed independently. This is the most common type of blob used for storing files such as documents, media files, and backups.
  2. Append blobs: Optimized for append operations, such as logging data from a virtual machine. Append blobs are made up of blocks, but they are specifically designed so that blocks can only be appended to the end of the blob.
  3. Page blobs: Optimized for random read and write operations. Page blobs store data in pages up to 512 bytes in size. They are primarily used for IaaS virtual machine disks.
Note: For most use cases, block blobs are the default and recommended choice.

Blob Name

A blob name is unique within a container. Every blob has a name.

Blob names can contain any combination of characters. However, to comply with REST access and HTTP URL conventions, it's recommended to use characters that are URL-safe. Blob names have a maximum length of 1024 characters.

A blob name can be represented as a virtual directory structure using forward slashes (/). For example, photos/2023/vacation/photo1.jpg.

Access Tiers

Azure Blob Storage offers different access tiers that can be used to store data at the most cost-effective levels. The access tiers are:

You can set the access tier at the account, container, or blob level.

Shared Access Signatures (SAS)

A Shared Access Signature (SAS) is a URI that grants restricted access rights to Azure Storage resources. A SAS token allows a client to delegate access to your storage account without sharing your account access keys.

SAS provides:

There are two types of SAS:

  1. Service SAS: Signed with the storage account key.
  2. User delegation SAS: Signed with Azure AD credentials.

Access Control

Azure Blob Storage supports multiple methods for controlling access to your data:

Example Scenario

Imagine you are building a web application that allows users to upload profile pictures. You would:

  1. Create an Azure Storage account.
  2. Inside the storage account, create a container named profile-pictures.
  3. When a user uploads a picture, upload it as a block blob to the profile-pictures container. The blob name could be {userId}.jpg.
  4. Grant read access to the profile-pictures container so that your web application can serve the images to users. You might use RBAC for this.
  5. If you need to provide temporary access for a user to download their own picture, you could generate a SAS token with read permissions for that specific blob.

This example illustrates how the core concepts of storage accounts, containers, blobs, and access control work together to manage your data effectively in Azure Blob Storage.