Create a Container in Azure Blob Storage

This document guides you through the process of creating a container in Azure Blob Storage. Containers are logical groupings for your blobs.

Note: Container names must be globally unique within a storage account.

Prerequisites

Create a Container using the Azure Portal

  1. Navigate to your storage account in the Azure portal.
  2. Under the "Data storage" section, select Containers.
  3. Select + Container from the toolbar.
  4. In the "Create container" pane, enter a name for your container.
    Important: Container names must start with a letter or number, can contain only letters, numbers, and the hyphen ('-'), and must be between 3 and 63 characters long.
  5. Choose an access level for the container (e.g., Private, Blob, or Container). The default is Private.
    • Private (no anonymous access): Access is restricted to authenticated users.
    • Blob: Anonymous read access for blobs only, within the container.
    • Container: Anonymous read access for the container and its blobs.
  6. Click Create.

Create a Container using Azure CLI

You can also create a container using the Azure Command-Line Interface (CLI).

First, ensure you have the Azure CLI installed and are logged in:

az login

Then, use the following command to create a container:

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

Replace <container-name> with your desired container name and <your-storage-account-name> with your storage account name.

Create a Container using Azure PowerShell

You can also create a container using Azure PowerShell.

First, ensure you have the Azure PowerShell module installed and are logged in:

Connect-AzAccount

Then, use the following command to create a container:

New-AzStorageContainer -Name "" -Context (New-AzStorageContext -StorageAccountName "" -StorageAccountKey "")

Replace <container-name>, <your-storage-account-name>, and <your-storage-account-key> with your specific details. Alternatively, you can use -UseConnectedAccount for authenticated access.

Tip: For programmatic access, consider using the Azure SDKs for your preferred programming language. These libraries provide robust methods for managing Azure Storage resources.

Next Steps