az vm identity
管理服务 VM 的服务标识。
命令
名称 | 说明 | 类型 | Status |
---|---|---|---|
az vm identity assign |
在 VM 上启用托管服务标识。 |
Core | GA |
az vm identity remove |
从 VM 中删除托管服务标识。 |
Core | GA |
az vm identity show |
显示 VM 的托管标识信息。 |
Core | GA |
az vm identity assign
在 VM 上启用托管服务标识。
必须使用持有者令牌对其他 Azure 服务进行身份验证和交互。
az vm identity assign [--identities]
[--ids]
[--name]
[--resource-group]
[--role]
[--scope]
[--subscription]
示例
在具有“读取者”角色的 VM 上启用系统分配的标识。
az vm identity assign -g MyResourceGroup -n MyVm --role Reader --scope /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup
在具有“读取者”角色的 VM 上启用系统分配的标识和用户分配的标识。
az vm identity assign -g MyResourceGroup -n MyVm --role Reader --identities [system] myAssignedId --scope /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
要分配的空间分隔标识。 使用“[system]”引用系统分配的标识。 Default: '[system]'.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
虚拟机的名称。 可以使用 < a0/a0> 配置默认值 az configure --defaults vm=<name>
。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
系统分配的标识将具有的角色名称或 ID。
系统分配的标识可以访问的范围。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az vm identity remove
从 VM 中删除托管服务标识。
az vm identity remove [--identities]
[--ids]
[--name]
[--resource-group]
[--subscription]
示例
删除系统分配的标识
az vm identity remove -g MyResourceGroup -n MyVm
删除用户分配的标识
az vm identity remove -g MyResourceGroup -n MyVm --identities readerId
删除与 VM 位于同一资源组中的 2 个标识
az vm identity remove -g MyResourceGroup -n MyVm --identities readerId writerId
删除系统分配的标识和用户标识
az vm identity remove -g MyResourceGroup -n MyVm --identities [system] readerId
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
要删除的空间分隔标识。 使用“[system]”引用系统分配的标识。 Default: '[system]'.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
虚拟机的名称。 可以使用 < a0/a0> 配置默认值 az configure --defaults vm=<name>
。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az vm identity show
显示 VM 的托管标识信息。
az vm identity show [--ids]
[--name]
[--resource-group]
[--subscription]
示例
显示 VM 的托管标识信息。 (autogenerated)
az vm identity show --name MyVirtualMachine --resource-group MyResourceGroup
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
虚拟机的名称。 可以使用 < a0/a0> 配置默认值 az configure --defaults vm=<name>
。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |