LinuxCommandLibrary

az-storage-container

Manage Azure Blob Storage containers

TLDR

Create a container

$ az storage container create -n [container-name] --account-name [account]
copy
Create with public blob access
$ az storage container create -n [container-name] --public-access blob --account-name [account]
copy
List all containers
$ az storage container list --account-name [account] -o table
copy
Check if a container exists
$ az storage container exists -n [container-name] --account-name [account]
copy
Show container properties
$ az storage container show -n [container-name] --account-name [account]
copy
Generate a SAS token for a container
$ az storage container generate-sas -n [container-name] --permissions [dlrw] --expiry [2024-12-31T00:00Z] --account-name [account]
copy
Delete a container
$ az storage container delete -n [container-name] --account-name [account]
copy
Restore a soft-deleted container
$ az storage container restore -n [container-name] --deleted-version [version] --account-name [account]
copy

SYNOPSIS

az storage container subcommand [options]

DESCRIPTION

az storage container manages blob storage containers in Azure Storage accounts. Containers provide a grouping of blobs similar to directories in a file system.
Containers can have different access levels: private (default), blob (anonymous read for blobs), or container (anonymous read for container and blobs). All blobs must reside in a container.

PARAMETERS

-n, --name value

Name of the container
--account-name value
Storage account name
--account-key value
Storage account key
--public-access value
Public access level: off, blob, container
--fail-on-exist
Fail if the container already exists
--permissions value
SAS permissions: (a)dd, (c)reate, (d)elete, (l)ist, (r)ead, (w)rite
--expiry value
SAS token expiration datetime (UTC)

SUBCOMMANDS

Container Lifecycle

create, delete, list, exists, show, restore
Access Control
set-permission, show-permission, generate-sas
Metadata
metadata show, metadata update
Leases
lease acquire, lease break, lease release, lease renew, lease change
Policies
policy create, policy delete, policy list, policy show, policy update
Compliance
immutability-policy create, immutability-policy delete, legal-hold set, legal-hold clear

CAVEATS

Container names must be 3-63 characters, lowercase letters, numbers, and hyphens only. Deleting a container deletes all contained blobs. Soft-delete policies allow recovery within the retention period. Immutability policies and legal holds prevent deletion for compliance purposes.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community