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

az blueprint artifact role

注意

此参考是 Azure CLI(版本 2.50.0 或更高版本)的蓝图扩展的一部分。 该扩展将在首次运行 az blueprint artifact role 命令时自动安装。 详细了解扩展。

用于管理蓝图角色分配项目的命令。

命令

名称 说明 类型 状态
az blueprint artifact role create

创建蓝图角色项目。

扩展 GA
az blueprint artifact role update

更新蓝图角色项目。

分机 GA

az blueprint artifact role create

创建蓝图角色项目。

az blueprint artifact role create --artifact-name
                                  --blueprint-name
                                  --principal-ids
                                  --role-definition-id
                                  [--depends-on]
                                  [--description]
                                  [--display-name]
                                  [--management-group]
                                  [--resource-group-art]
                                  [--subscription]

示例

创建角色项目

az blueprint artifact role create \
--blueprint-name MyBlueprint --artifact-name MyRole --role-definition-id \
"/providers/Microsoft.Authorization/roleDefinitions/00000000-0000-0000-0000-000000000000" \
--principal-ids "[parameters('[Usergrouporapplicationname]:MyRoleAssignmentName')]"

必需参数

--artifact-name

蓝图项目的名称。

--blueprint-name

蓝图定义的名称。

--principal-ids

Azure Active Directory 中的用户或组标识数组或对蓝图定义中的相应参数的引用。 roleDefinition 将应用于每个标识。

--role-definition-id

完整角色定义 ID。仅支持内置角色。

可选参数

--depends-on

需要在指定项目之前部署的项目。

--description

蓝图项目的说明。

--display-name

此项目的 DisplayName。

--management-group -m

将管理组用于蓝图的范围。

--resource-group-art

将向其分配策略的资源组项目的名称。

--subscription -s

将订阅用于蓝图的范围。 如果未指定 --management-group,则 --subscription 值或默认订阅将用作范围。

全局参数
--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 blueprint artifact role update

更新蓝图角色项目。

az blueprint artifact role update --artifact-name
                                  --blueprint-name
                                  [--depends-on]
                                  [--description]
                                  [--display-name]
                                  [--management-group]
                                  [--resource-group-art]
                                  [--subscription]

示例

更新角色项目

az blueprint artifact role update \
--blueprint-name MyBlueprint --artifact-name MyRole --display-name "My Big Role"

必需参数

--artifact-name

蓝图项目的名称。

--blueprint-name

蓝图定义的名称。

可选参数

--depends-on

需要在指定项目之前部署的项目。 使用不带值的“--depends-on”删除依赖项。

--description

蓝图项目的说明。

--display-name

此项目的 DisplayName。

--management-group -m

将管理组用于蓝图的范围。

--resource-group-art

将向其分配策略的资源组项目的名称。

--subscription -s

将订阅用于蓝图的范围。 如果未指定 --management-group,则 --subscription 值或默认订阅将用作范围。

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