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
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.
Storage account key.
Storage account name. Used with the container name when --url is not given.
An opaque, globally-unique, client-generated string identifier for the request.
The default encryption scope for all writes to the container.
Metadata in space-separated key=value pairs.
The container name.
Block writes that specify an encryption scope other than the container default.
The public access level. Omit for private access.
| Property | Value |
|---|---|
| Accepted values: | blob, container |
A shared access signature. Alternative to --account-key.
The timeout parameter is expressed in seconds.
The container URL. Alternative to --account-name and --name.
Global Parameters
Increase logging verbosity to show all debug logs.
Show help for the command or group and exit.
Bypass the extension discovery cache and reload extensions from disk.
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, table, tsv, yaml, yamlc |
JMESPath query string to filter/project the command result before rendering.
az storage container delete
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.
Storage account key.
Storage account name. Used with the container name when --url is not given.
An opaque, globally-unique, client-generated string identifier for the request.
Delete only if the container has been modified since the specified date-time.
Delete only if the container has not been modified since the specified date-time.
If specified, the operation only succeeds if the container's lease is active and matches this ID.
The container name.
A shared access signature. Alternative to --account-key.
The timeout parameter is expressed in seconds.
The container URL. Alternative to --account-name and --name.
Global Parameters
Increase logging verbosity to show all debug logs.
Show help for the command or group and exit.
Bypass the extension discovery cache and reload extensions from disk.
Output format.
| Property | Value |
|---|---|
| Default value: | json |
| Accepted values: | json, jsonc, table, tsv, yaml, yamlc |
JMESPath query string to filter/project the command result before rendering.