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

az acr scope-map

管理 Azure 容器注册表的范围访问映射。

命令

名称 说明 类型 状态
az acr scope-map create

为Azure 容器注册表创建范围映射。

核心 GA
az acr scope-map delete

删除Azure 容器注册表的范围映射。

核心 GA
az acr scope-map list

列出Azure 容器注册表的所有范围映射。

核心 GA
az acr scope-map show

显示Azure 容器注册表的范围映射的详细信息和属性。

核心 GA
az acr scope-map update

更新Azure 容器注册表的范围映射。

核心 GA

az acr scope-map create

为Azure 容器注册表创建范围映射。

az acr scope-map create --name
                        --registry
                        [--description]
                        [--gateway]
                        [--repository]
                        [--resource-group]

示例

创建范围映射,允许“hello-world”存储库的内容/写入和元数据/读取操作,以及“hello-world-again”的内容/读取操作。

az acr scope-map create -n MyScopeMap -r myregistry --repository hello-world content/write metadata/read --repository hello-world-again content/read --description "Sample scope map."

创建范围映射,允许“test”的所有存储库操作,以及“connectedRegistry”的所有网关操作。

az acr scope-map create -n MyScopeMap -r myregistry --description "Sample scope map."
  --repository test content/delete content/read content/write metadata/read metadata/write
  --gateway connectedRegistry config/read config/write message/read message/write

必需参数

--name -n

范围映射的名称。

--registry -r

容器注册表的名称。 它应以小写形式指定。 可以使用 配置默认注册表名称 az configure --defaults acr=<registry name>

可选参数

--description

范围映射的说明。 最多允许 256 个字符。

--gateway

网关权限。 使用每个标志的“--gateway GATEWAY [ACTION1 ACTION2 ...]”格式。 有效操作为 ['config/read', 'config/write', 'message/read', 'message/write']。

--repository

存储库权限。 每个标志使用格式“--repository REPO [ACTION1 ACTION2 ...]”。 有效操作为 ['content/delete', 'content/read', 'content/write', 'metadata/read', 'metadata/write']。

--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 acr scope-map delete

删除Azure 容器注册表的范围映射。

az acr scope-map delete --name
                        --registry
                        [--resource-group]
                        [--yes]

示例

删除范围映射“MyScopeMap”。

az acr scope-map delete -n MyScopeMap -r myregistry

必需参数

--name -n

范围映射的名称。

--registry -r

容器注册表的名称。 它应以小写形式指定。 可以使用 配置默认注册表名称 az configure --defaults acr=<registry name>

可选参数

--resource-group -g

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

--yes -y

不提示确认。

全局参数
--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 acr scope-map list

列出Azure 容器注册表的所有范围映射。

az acr scope-map list --registry
                      [--resource-group]

示例

列表范围映射在注册表“myregistry”下。

az acr scope-map list -r myregistry

必需参数

--registry -r

容器注册表的名称。 它应以小写形式指定。 可以使用 配置默认注册表名称 az configure --defaults acr=<registry name>

可选参数

--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 acr scope-map show

显示Azure 容器注册表的范围映射的详细信息和属性。

az acr scope-map show --name
                      --registry
                      [--resource-group]

示例

获取范围映射“MyScopeMap”的信息。

az acr scope-map show -n MyScopeMap -r myregistry

必需参数

--name -n

范围映射的名称。

--registry -r

容器注册表的名称。 它应以小写形式指定。 可以使用 配置默认注册表名称 az configure --defaults acr=<registry name>

可选参数

--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 acr scope-map update

更新Azure 容器注册表的范围映射。

az acr scope-map update --name
                        --registry
                        [--add-gateway]
                        [--add-repository]
                        [--description]
                        [--remove-gateway]
                        [--remove-repository]
                        [--resource-group]

示例

更新范围映射“MyScopeMap”,删除“hello-world”存储库的元数据/读取和内容/读取操作,以及“connectedRegistry”的消息/写入操作。

az acr scope-map update -n MyScopeMap -r myregistry --remove-repo hello-world metadata/read content/read --remove-gateway connectedRegistry message/write

必需参数

--name -n

范围映射的名称。

--registry -r

容器注册表的名称。 它应以小写形式指定。 可以使用 配置默认注册表名称 az configure --defaults acr=<registry name>

可选参数

--add-gateway

要添加的网关权限。 使用每个标志的“--add-gateway GATEWAY [ACTION1 ACTION2 ...]”格式。 有效操作为 ['config/read', 'config/write', 'message/read', 'message/write']。

--add-repository

要添加的存储库权限。 每个标志使用格式“--add-repository REPO [ACTION1 ACTION2 ...]”。 有效操作为 ['content/delete', 'content/read', 'content/write', 'metadata/read', 'metadata/write']。

--description

范围映射的说明。 最多允许 256 个字符。

--remove-gateway

要删除的网关权限。 使用每个标志的“--remove-gateway GATEWAY [ACTION1 ACTION2 ...]”格式。 有效操作为 ['config/read', 'config/write', 'message/read', 'message/write']。

--remove-repository

要删除的存储库权限。 每个标志使用格式“--remove-repository REPO [ACTION1 ACTION2 ...]”。 有效操作为 ['content/delete', 'content/read', 'content/write', 'metadata/read', 'metadata/write']。

--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 获取完整的调试日志。