Share via


az storage container-rm

Manage Azure containers using the Microsoft.Storage resource provider.

Commands

Name Description Type Status
az storage container-rm create

Create a new container under the specified storage account.

Core GA
az storage container-rm delete

Delete the specified container under its account.

Core GA
az storage container-rm exists

Check for the existence of a container.

Core GA
az storage container-rm list

List all containers under the specified storage account.

Core GA
az storage container-rm migrate-vlw

Migrate a blob container from container level WORM to object level immutability enabled container.

Core Preview
az storage container-rm show

Show the properties for a specified container.

Core GA
az storage container-rm update

Update the properties for a container.

Core GA

az storage container-rm create

Create a new container under the specified storage account.

az storage container-rm create --name
                               --storage-account
                               [--default-encryption-scope]
                               [--deny-encryption-scope-override --deny-override {false, true}]
                               [--enable-vlw {false, true}]
                               [--fail-on-exist]
                               [--metadata]
                               [--public-access {blob, container, off}]
                               [--resource-group]
                               [--root-squash {AllSquash, NoRootSquash, RootSquash}]

Examples

Create a new container under the specified storage account.

az storage container-rm create --storage-account myaccount --name mycontainer

Create a new container with metadata and public-access as blob under the specified storage account(account id).

az storage container-rm create --storage-account myaccountid --name mycontainer --public-access blob --metada key1=value1 key2=value2

Required Parameters

--name -n

The container name.

--storage-account

The name or ID of the storage account.

Optional Parameters

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

--default-encryption-scope -d

Default the container to use specified encryption scope for all writes.

Property Value
Parameter group: Encryption Policy Arguments
--deny-encryption-scope-override --deny-override

Block override of encryption scope from the container default.

Property Value
Parameter group: Encryption Policy Arguments
Accepted values: false, true
--enable-vlw
Preview

The object level immutability property of the container. The property is immutable and can only be set to true at the container creation time. Existing containers must undergo a migration process.

Property Value
Accepted values: false, true
--fail-on-exist

Throw an exception if the container already exists.

Property Value
Default value: False
--metadata

Metadata in space-separated key=value pairs. This overwrites any existing metadata.

--public-access

Specify whether data in the container may be accessed publicly.

Property Value
Accepted values: blob, container, off
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--root-squash

Enable NFSv3 squash on blob container.

Property Value
Accepted values: AllSquash, NoRootSquash, RootSquash
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az storage container-rm delete

Delete the specified container under its account.

az storage container-rm delete [--ids]
                               [--name]
                               [--resource-group]
                               [--storage-account]
                               [--subscription]
                               [--yes]

Examples

Delete the specified container under its account.

az storage container-rm delete --storage-account myAccount --name mycontainer

Delete the specified container under its account(account id).

az storage container-rm delete --storage-account myaccountid --name mycontainer

Delete the specified container by resource id.

az storage container-rm delete --ids mycontainerid

Optional Parameters

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

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name -n

The container name.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--storage-account

The name or ID of the storage account.

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
--yes -y

Do not prompt for confirmation.

Property Value
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az storage container-rm exists

Check for the existence of a container.

az storage container-rm exists [--ids]
                               [--name]
                               [--resource-group]
                               [--storage-account]
                               [--subscription]

Examples

Check for the existence of a container under the specified storage account.

az storage container-rm exists --storage-account myaccount --name mycontainer

Check for the existence of a container under the specified storage account(account id).

az storage container-rm exists --storage-account myaccountid --name mycontainer

Check for the existence of a container by resource id.

az storage container-rm exists --ids mycontainerid

Optional Parameters

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

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name -n

The container name.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--storage-account

The name or ID of the storage account.

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az storage container-rm list

List all containers under the specified storage account.

az storage container-rm list --storage-account
                             [--include-deleted]
                             [--resource-group]

Examples

List all containers under the specified storage account.

az storage container-rm list --storage-account myaccount

List all containers under the specified storage account(account id).

az storage container-rm list --storage-account myaccountid

List all containers under the specified storage account, including deleted ones.

az storage container-rm list --storage-account myaccount --include-deleted

Required Parameters

--storage-account

The name or ID of the storage account.

Optional Parameters

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

--include-deleted

Include soft deleted containers when specified.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az storage container-rm migrate-vlw

Preview

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Migrate a blob container from container level WORM to object level immutability enabled container.

az storage container-rm migrate-vlw [--ids]
                                    [--name]
                                    [--no-wait]
                                    [--resource-group]
                                    [--storage-account]
                                    [--subscription]

Examples

Migrate a blob container from container level WORM to object level immutability enabled container.

az storage container-rm migrate-vlw -n mycontainer --storage-account myaccount -g myresourcegroup

Migrate a blob container from container level WORM to object level immutability enabled container without waiting.

az storage container-rm migrate-vlw -n mycontainer --storage-account myaccount -g myresourcegroup --no-wait
az storage container-rm show -n mycontainer --storage-account myaccount -g myresourcegroup  --query immutableStorageWithVersioning.migrationState

Optional Parameters

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

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name -n

The container name.

Property Value
Parameter group: Resource Id Arguments
--no-wait

Do not wait for the long-running operation to finish.

Property Value
Default value: False
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--storage-account

The name or ID of the storage account.

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az storage container-rm show

Show the properties for a specified container.

az storage container-rm show [--ids]
                             [--name]
                             [--resource-group]
                             [--storage-account]
                             [--subscription]

Examples

Show the properties for a container under the specified storage account.

az storage container-rm show --storage-account myaccount --name mycontainer

Show the properties for a container under the specified storage account(account id).

az storage container-rm show --storage-account myaccountid --name mycontainer

Show the properties for a container by resource id.

az storage container-rm show --ids mycontainerid

Optional Parameters

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

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--name -n

The container name.

Property Value
Parameter group: Resource Id Arguments
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--storage-account

The name or ID of the storage account.

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az storage container-rm update

Update the properties for a container.

az storage container-rm update [--add]
                               [--force-string]
                               [--ids]
                               [--metadata]
                               [--name]
                               [--public-access {blob, container, off}]
                               [--remove]
                               [--resource-group]
                               [--root-squash {AllSquash, NoRootSquash, RootSquash}]
                               [--set]
                               [--storage-account]
                               [--subscription]

Examples

Update the public access level to 'blob' for a container under the specified storage account.

az storage container-rm update --storage-account myaccount --name mycontainer --public-access blob

Update the metadata for a container under the specified storage account(account id).

az storage container-rm update --storage-account myaccountid --name mycontainer --metadata newkey1=newvalue1 newkey2=newvalue2

Update the public access level for a container by resource id.

az storage container-rm update --ids mycontainerid --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.

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

Property Value
Parameter group: Generic Update Arguments
Default value: []
--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

Property Value
Parameter group: Generic Update Arguments
Default value: False
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

Property Value
Parameter group: Resource Id Arguments
--metadata

Metadata in space-separated key=value pairs. This overwrites any existing metadata.

--name -n

The container name.

Property Value
Parameter group: Resource Id Arguments
--public-access

Specify whether data in the container may be accessed publicly.

Property Value
Accepted values: blob, container, off
--remove

Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.

Property Value
Parameter group: Generic Update Arguments
Default value: []
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Property Value
Parameter group: Resource Id Arguments
--root-squash

Enable NFSv3 squash on blob container.

Property Value
Accepted values: AllSquash, NoRootSquash, RootSquash
--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.

Property Value
Parameter group: Generic Update Arguments
Default value: []
--storage-account

The name or ID of the storage account.

Property Value
Parameter group: Resource Id Arguments
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Property Value
Parameter group: Resource Id Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

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

JMESPath query string. See http://jmespath.org/ for more information and examples.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False