Introduction to Azure Blob Storage
Azure Blob Storage is Microsoft's highly scalable object storage solution for the cloud. Blob storage is optimized to store massive amounts of unstructured data, such as text or binary data. Unstructured data is data that doesn't adhere to a particular data model or definition, such as images, videos, audio files, or any other type of media file, documents, or backups.
You can use Blob Storage to:
- Serve images or documents directly to a browser.
- Store files for distributed access.
- Stream video and audio files.
- Write to log files.
- Store data for backup and restore, disaster recovery, and archiving.
- Store data for analysis by an on-premises or hosted Azure service.
Getting Started with Blob Storage
Create an Azure Storage Account
Before you can use Blob Storage, you need an Azure Storage account. A storage account provides a unique namespace in Azure for your data.
Follow these steps to create a storage account:
- Sign in to the Azure portal.
- Navigate to Storage accounts and click Create.
- Fill in the required fields: Subscription, Resource group, Storage account name, Region, and Performance. Choose Standard or Premium depending on your needs.
- For the Replication setting, choose the redundancy option that best suits your needs (e.g., Locally-redundant storage (LRS), Geo-redundant storage (GRS)).
- Click Review + create, and then click Create.
Create a Container
Blobs are stored in containers. A container is a logical grouping of blobs, similar to a folder in a file system.
In the Azure portal, navigate to your storage account, then under Data storage, select Containers. Click + Container, provide a name, and set the public access level.
Upload a Blob
You can upload blobs using the Azure portal, Azure Storage Explorer, Azure CLI, PowerShell, or by using one of the Azure Storage SDKs.
Using Azure Portal:
- Navigate to the container you created.
- Click the Upload button.
- Select the file(s) you want to upload.
- Choose the blob type (Block Blob, Append Blob, or Page Blob) and any advanced options.
Example using Azure CLI:
az storage blob upload \
--account-name <your-storage-account-name> \
--container-name <your-container-name> \
--name <blob-name> \
--file <path-to-your-file> \
--auth-mode login
Key Concepts in Blob Storage
Blobs
A blob is a collection of data stored as a single unit. Blob storage supports three types of blobs:
- Block Blobs: Optimized for storing large amounts of unstructured data, such as documents or media files. Block blobs are made up of blocks, each of which can be a different size.
- Append Blobs: Optimized for append operations, such as writing to log files. Append blobs are made up of blocks, but blocks can only be added to the end of the blob.
- Page Blobs: Optimized for random read and write operations. Page blobs are made up of pages ranging from 512 bytes to 4 MB in size.
Containers
A container is a mandatory first level of organization in Blob Storage, similar to a directory in a file system. A storage account can contain an unlimited number of containers, but each container can only contain blobs.
Storage Tiers
Azure Blob Storage offers different access tiers to store data at the right price point:
- Hot: Optimized for frequently accessed data. Lower storage costs, higher access costs.
- Cool: Optimized for infrequently accessed data. Higher storage costs, lower access costs. Data is stored for at least 30 days.
- Archive: Optimized for rarely accessed data that can tolerate several hours of retrieval time. Lowest storage costs, highest access costs. Data is stored for at least 180 days.
You can rehydrate data from Cool or Archive tiers to Hot tier.
API Reference
Explore the comprehensive REST API reference for Azure Blob Storage operations:
Blob Service REST API Reference
Azure SDKs
Use the Azure SDKs to interact with Blob Storage from your applications:
Tutorials and Quickstarts
Get hands-on with tutorials and quickstarts to get started quickly: