Azure Storage Blobs Documentation

List Containers

This document explains how to list containers in an Azure Storage account using various methods.

Note: Container names are case-insensitive and must start with a letter or number, and can contain only letters, numbers, and the hyphen (-) character. The hyphen cannot be the first or last character of the name.

Introduction

Containers are fundamental organizational units within Azure Blob Storage. They act as logical groupings for your blobs. You can list containers to view their properties, manage them, or retrieve data from them.

Methods for Listing Containers

You can list containers using the following methods:

Azure CLI

Use the Azure CLI to list containers in a storage account.

Command

az storage container list --account-name  --output table

Explanation

  • az storage container list: The command to list blob containers.
  • --account-name <YOUR_STORAGE_ACCOUNT_NAME>: Specifies the name of your Azure Storage account.
  • --output table: Formats the output as a table for better readability. Other options include json, tsv, and yaml.

Example Output

Name PublicAccess LeaseState LeaseStatus HasImmutabilityPolicy HasLegalHold
my-container-1 off Available Unlocked False False
data-archive off Available Unlocked False False

Next Steps