az storage container-rm

Manage Azure containers using the Microsoft.Storage resource provider.

Commands

az storage container-rm create

Create a new container under the specified storage account.

az storage container-rm delete

Delete the specified container under its account.

az storage container-rm exists

Check for the existence of a container.

az storage container-rm list

List all containers under the specified storage account.

az storage container-rm migrate-vlw

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

az storage container-rm show

Show the properties for a specified container.

az storage container-rm update

Update the properties for a container.

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 {false, true}]
                               [--enable-vlw {false, true}]
                               [--fail-on-exist]
                               [--metadata]
                               [--public-access {blob, container, off}]
                               [--resource-group]
                               [--root-squash {AllSquash, NoRootSquash, RootSquash}]
                               [--subscription]

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

--default-encryption-scope -d

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

--deny-encryption-scope-override --deny-override

Block override of encryption scope from the container default.

accepted values: false, true
--enable-vlw

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.

accepted values: false, true
--fail-on-exist

Throw an exception if the container already exists.

--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.

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.

accepted values: AllSquash, NoRootSquash, RootSquash
--subscription

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

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

--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.

--name -n

The container name.

--resource-group -g

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

--storage-account

The name or ID of the storage account.

--subscription

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

--yes -y

Do not prompt for confirmation.

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

--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.

--name -n

The container name.

--resource-group -g

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

--storage-account

The name or ID of the storage account.

--subscription

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

az storage container-rm list

List all containers under the specified storage account.

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

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

--include-deleted

Include soft deleted containers when specified.

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--resource-group -g

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

--subscription

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

az storage container-rm migrate-vlw

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

--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.

--name -n

The container name.

--no-wait

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

--resource-group -g

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

--storage-account

The name or ID of the storage account.

--subscription

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

az storage container-rm show

Show the properties for a specified container.

az storage container-rm show [--ids]
                             [--name]
                             [--query-examples]
                             [--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

--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.

--name -n

The container name.

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--resource-group -g

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

--storage-account

The name or ID of the storage account.

--subscription

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

az storage container-rm update

Update the properties for a container.

az storage container-rm update [--add]
                               [--default-encryption-scope]
                               [--deny-encryption-scope-override {false, true}]
                               [--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 default encryption scope for a container by resource id.

az storage container-rm update --ids mycontainerid --default-encryption-scope myencryptionscope

Optional Parameters

--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>.

--default-encryption-scope -d

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

--deny-encryption-scope-override --deny-override

Block override of encryption scope from the container default.

accepted values: false, true
--force-string

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

--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.

--metadata

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

--name -n

The container name.

--public-access

Specify whether data in the container may be accessed publicly.

accepted values: blob, container, off
--remove

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

--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.

accepted values: AllSquash, NoRootSquash, RootSquash
--set

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

--storage-account

The name or ID of the storage account.

--subscription

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