az storage container

Manage blob containers.

Commands

Name Description Type Status
az storage container create

Create a blob container.

Core Preview
az storage container delete

Delete a blob container.

Core Preview

az storage container create

Preview

Create a blob container.

Create a container in a storage account. Containers are private by default; use --public-access to allow anonymous read access to blobs or to the whole container.

az storage container create [--account-key]
                            [--account-name]
                            [--client-request-id]
                            [--default-encryption-scope]
                            [--metadata]
                            [--name]
                            [--prevent-encryption-scope-override]
                            [--public-access {blob, container}]
                            [--sas-token]
                            [--timeout]
                            [--url]

Examples

Create a private container

az storage container create --account-name mystorageaccount --account-key $ACCOUNT_KEY --name mycontainer

Create a container with anonymous blob read access

az storage container create --account-name mystorageaccount --account-key $ACCOUNT_KEY --name publiccontainer --public-access blob

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--account-key

Storage account key.

--account-name

Storage account name. Used with the container name when --url is not given.

--client-request-id

An opaque, globally-unique, client-generated string identifier for the request.

--default-encryption-scope

The default encryption scope for all writes to the container.

--metadata

Metadata in space-separated key=value pairs.

--name

The container name.

--prevent-encryption-scope-override

Block writes that specify an encryption scope other than the container default.

--public-access

The public access level. Omit for private access.

Property Value
Accepted values: blob, container
--sas-token

A shared access signature. Alternative to --account-key.

--timeout

The timeout parameter is expressed in seconds.

--url

The container URL. Alternative to --account-name and --name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.

az storage container delete

Preview

Delete a blob container.

Mark a container and all blobs in it for deletion. The container is removed later by garbage collection, and a container with the same name can't be created until then.

az storage container delete [--account-key]
                            [--account-name]
                            [--client-request-id]
                            [--if-modified-since]
                            [--if-unmodified-since]
                            [--lease-id]
                            [--name]
                            [--sas-token]
                            [--timeout]
                            [--url]

Examples

Delete a container

az storage container delete --account-name mystorageaccount --account-key $ACCOUNT_KEY --name mycontainer

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--account-key

Storage account key.

--account-name

Storage account name. Used with the container name when --url is not given.

--client-request-id

An opaque, globally-unique, client-generated string identifier for the request.

--if-modified-since

Delete only if the container has been modified since the specified date-time.

--if-unmodified-since

Delete only if the container has not been modified since the specified date-time.

--lease-id

If specified, the operation only succeeds if the container's lease is active and matches this ID.

--name

The container name.

--sas-token

A shared access signature. Alternative to --account-key.

--timeout

The timeout parameter is expressed in seconds.

--url

The container URL. Alternative to --account-name and --name.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h -help -? --?

Show help for the command or group and exit.

--no-cache

Bypass the extension discovery cache and reload extensions from disk.

--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, table, tsv, yaml, yamlc
--query

JMESPath query string to filter/project the command result before rendering.