Κοινή χρήση μέσω


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

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

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

Throw an exception if the container already exists.

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.

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
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

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.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

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.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

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

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

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

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

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

Default value: False
--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.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

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

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.

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

--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 value: []
--force-string

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

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.

--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 <indexToRemove> OR --remove propertyToRemove.

Default value: []
--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=<value>.

Default value: []
--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.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--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.