你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

az storage container-rm

使用 Microsoft 管理 Azure 容器。存储资源提供程序。

命令

名称 说明 类型 状态
az storage container-rm create

在指定的存储帐户下创建新容器。

核心 GA
az storage container-rm delete

在其帐户下删除指定的容器。

核心 GA
az storage container-rm exists

检查容器是否存在。

核心 GA
az storage container-rm list

列出指定存储帐户下的所有容器。

核心 GA
az storage container-rm migrate-vlw

将 Blob 容器从容器级别 WORM 迁移到启用了对象级别的不可变性容器。

核心 预览
az storage container-rm show

显示指定容器的属性。

核心 GA
az storage container-rm update

更新容器的属性。

核心 GA

az storage container-rm create

在指定的存储帐户下创建新容器。

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}]

示例

在指定的存储帐户下创建新容器。

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

在指定的存储帐户(帐户 ID)下,使用元数据和公共访问作为 blob 创建新容器。

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

必需参数

--name -n

容器名称。

--storage-account

存储帐户的名称或 ID。

可选参数

--default-encryption-scope -d

将容器默认为所有写入使用指定的加密范围。

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

阻止从容器默认值替代加密范围。

接受的值: false, true
--enable-vlw
预览

容器的对象级别不可变性属性。 该属性是不可变的,只能在容器创建时设置为 true。 现有容器必须经历迁移过程。

接受的值: false, true
--fail-on-exist

如果容器已存在,则引发异常。

默认值: False
--metadata

空格分隔键=值对中的元数据。 这会覆盖任何现有元数据。

--public-access

指定是否可以公开访问容器中的数据。

接受的值: blob, container, off
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--root-squash

在 Blob 容器上启用 NFSv3 壁球。

接受的值: AllSquash, NoRootSquash, RootSquash
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az storage container-rm delete

在其帐户下删除指定的容器。

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

示例

在其帐户下删除指定的容器。

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

在其帐户(帐户 ID)下删除指定的容器。

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

按资源 ID 删除指定的容器。

az storage container-rm delete --ids mycontainerid

可选参数

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--name -n

容器名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--storage-account

存储帐户的名称或 ID。

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--yes -y

不提示确认。

默认值: False
全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az storage container-rm exists

检查容器是否存在。

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

示例

检查指定存储帐户下是否存在容器。

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

检查指定存储帐户(帐户 ID)下是否存在容器。

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

按资源 ID 检查容器是否存在。

az storage container-rm exists --ids mycontainerid

可选参数

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--name -n

容器名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--storage-account

存储帐户的名称或 ID。

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az storage container-rm list

列出指定存储帐户下的所有容器。

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

示例

列出指定存储帐户下的所有容器。

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

列出指定存储帐户(帐户 ID)下的所有容器。

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

列出指定存储帐户下的所有容器,包括已删除的容器。

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

必需参数

--storage-account

存储帐户的名称或 ID。

可选参数

--include-deleted

指定时包括软删除的容器。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az storage container-rm migrate-vlw

预览

此命令处于预览阶段,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

将 Blob 容器从容器级别 WORM 迁移到启用了对象级别的不可变性容器。

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

示例

将 Blob 容器从容器级别 WORM 迁移到启用了对象级别的不可变性容器。

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

将 Blob 容器从容器级别 WORM 迁移到启用了对象级别的不可变性容器,而无需等待。

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

可选参数

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--name -n

容器名称。

--no-wait

不等待长时间运行的操作完成。

默认值: False
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--storage-account

存储帐户的名称或 ID。

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az storage container-rm show

显示指定容器的属性。

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

示例

显示指定存储帐户下容器的属性。

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

显示指定存储帐户(帐户 ID)下容器的属性。

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

按资源 ID 显示容器的属性。

az storage container-rm show --ids mycontainerid

可选参数

--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--name -n

容器名称。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--storage-account

存储帐户的名称或 ID。

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az storage container-rm update

更新容器的属性。

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]

示例

将指定存储帐户下的容器的公共访问级别更新为“blob”。

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

在指定的存储帐户(帐户 ID)下更新容器的元数据。

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

按资源 ID 更新容器的公共访问级别。

az storage container-rm update --ids mycontainerid --public-access blob

可选参数

--add

通过指定路径和键值对将对象添加到对象列表。 示例:--add property.listProperty <key=value, string or JSON string>

默认值: []
--force-string

使用“set”或“add”时,保留字符串文本,而不是尝试转换为 JSON。

默认值: False
--ids

一个或多个资源 ID(以空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--metadata

空格分隔键=值对中的元数据。 这会覆盖任何现有元数据。

--name -n

容器名称。

--public-access

指定是否可以公开访问容器中的数据。

接受的值: blob, container, off
--remove

从列表中删除属性或元素。 示例: --remove property.list <indexToRemove> OR --remove propertyToRemove.

默认值: []
--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--root-squash

在 Blob 容器上启用 NFSv3 壁球。

接受的值: AllSquash, NoRootSquash, RootSquash
--set

通过指定要设置的属性路径和值来更新对象。 示例:--set property1.property2=<value>

默认值: []
--storage-account

存储帐户的名称或 ID。

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。