Containers - Azure Blob Storage

Learn how to create, manage, and configure containers in Azure Blob Storage.

Containers

Containers are the fundamental building blocks for storing data in Azure Blob Storage. A container is a logical grouping of blobs, similar to a folder in a file system.

Every blob in Azure Storage must reside within a container. A storage account can contain any number of containers, and a container can contain any number of blobs.

Creating a Container

You can create containers using various methods:

Using Azure CLI

To create a container using the Azure CLI, use the following command:

az storage container create --name mycontainer --account-name mystorageaccount --auth-mode login

Replace mycontainer with the desired name for your container and mystorageaccount with your storage account name.

Using REST API

The following REST API request creates a container:

PUT https://mystorageaccount.blob.core.windows.net/mycontainer?restype=container
Authorization: SharedKey mystorageaccount:YourAccessSignature
x-ms-date: Tue, 29 Jul 2014 22:37:22 GMT
Content-Length: 0

Container Properties

Each container has several important properties:

Accessing Containers

Access to containers and their blobs is controlled by authorization mechanisms, including:

Important Note on Naming

Container names must be unique within a storage account and follow these naming conventions:

Managing Containers

You can perform various management operations on containers:

Example: Setting Public Access Level

To set a container to allow anonymous read access for blobs using Azure CLI:

az storage container set-permission --name mycontainer --public-access blob --account-name mystorageaccount --auth-mode login

Best Practices