“az storage container” Command Examples

The “az storage container” command is a feature of the Azure Command-Line Interface (CLI) that allows you to manage blob storage containers in Azure. Azure CLI is a powerful command-line tool that provides a way to interact with and manage Azure resources directly from your command-line or scripting environment.

Blob storage is a service offered by Microsoft Azure that provides a scalable and secure way to store and access large amounts of unstructured data, such as images, videos, documents, and logs. Blob storage organizes data into containers, which act as logical units for grouping related blobs.

With the “az storage container” command, you can perform various operations on blob storage containers, such as creating new containers, listing existing containers, deleting containers, setting access permissions, and retrieving metadata associated with containers. These operations allow you to effectively manage your blob storage containers and control access to the data stored within them.

By using the Azure CLI, you can automate repetitive tasks, create scripts, and integrate Azure management operations into your workflows. The “az storage container” command is just one of many commands available in the Azure CLI, which provides a comprehensive set of tools for managing various Azure services and resources.

az storage container Command Examples

1. Create a container in a storage account:

# az storage container create --account-name storage_account_name --name container_name --public-access access_level --fail-on-exist

2. Generate a shared access signature for the container:

# az storage container generate-sas --account-name storage_account_name --name container_name --permissions sas_permissions --expiry expiry_date --https-only

3. List containers in a storage account:

# az storage container list --account-name storage_account_name --prefix filter_prefix

4. Mark the specified container for deletion:

# az storage container delete --account-name storage_account_name --name container_name --fail-not-exist

Summary

Overall, the “az storage container” command, as part of the Azure CLI, provides a convenient and efficient way to manage your blob storage containers in Azure, enabling you to organize and control your data storage effectively.

Related Post