Microsoft.ManagedIdentity.IdentitySelector UI 元素Microsoft.ManagedIdentity.IdentitySelector UI element

用于为部署中的资源分配托管标识的控件。A control for assigning managed identities for a resource in a deployment.

UI 示例UI sample

此控件由以下元素组成:The control consists of the following elements:

Microsoft.ManagedIdentity.IdentitySelector 第一步

当用户选择“添加” 时,将打开以下窗体。When the user selects Add, the following form opens. 用户可以为资源选择一个或多个用户分配的标识。The user can select one or more user-assigned identities for the resource.

Microsoft.ManagedIdentity.IdentitySelector 第二步

所选的标识将显示在表中。The selected identities are displayed in the table. 用户可以从此表中添加或删除项。The user can add or delete items from this table.

Microsoft.ManagedIdentity.IdentitySelector 第三步

架构Schema

{
  "name": "identity",
  "type": "Microsoft.ManagedIdentity.IdentitySelector",
  "label": "Managed Identity Configuration",
  "toolTip": {
    "systemAssignedIdentity": "Enable system assigned identity to grant the resource access to other existing resources.",
    "userAssignedIdentity": "Add user assigned identities to grant the resource access to other existing resources."
  },
  "defaultValue": {
    "systemAssignedIdentity": "Off"
  },
  "options": {
    "hideSystemAssignedIdentity": false,
    "hideUserAssignedIdentity": false
  },
  "visible": true
}

示例输出Sample output

{
  "identity": {
    "value": {
      "type": "UserAssigned",
      "userAssignedIdentities": {
        "/subscriptions/xxxx/resourceGroups/TestResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/TestUserIdentity1": {}
      }
    }
  }
}

备注Remarks

  • 使用 defaultValue.systemAssignedIdentity 为系统分配的标识选项控件设置初始值。Use defaultValue.systemAssignedIdentity to set an initial value for the system assigned identity options control. 默认值为 OffThe default value is Off. 允许以下值:The following values are allowed:

    • On - 系统分配的标识将分配给资源。On - A system assigned identity is assigned to the resource.
    • Off - 不会将系统分配的标识分配给资源。Off - A system assigned identity isn't assigned to the resource.
    • OnOnly - 系统分配的标识将分配给资源。OnOnly - A system assigned identity is assigned to the resource. 在部署期间,用户无法编辑此值。Users can't edit this value during deployment.
    • OffOnly - 不会将系统分配的标识分配给资源。OffOnly - A system assigned identity isn't assigned to the resource. 在部署期间,用户无法编辑此值。Users can't edit this value during deployment.
  • 如果 options.hideSystemAssignedIdentity 设为 true,则不会显示用于配置系统分配标识的 UI。If options.hideSystemAssignedIdentity is set to true, the UI to configure the system assigned identity isn't displayed. 此选项的默认值为 falseThe default value for this option is false.

  • 如果 options.hideUserAssignedIdentity 设为 true,则不会显示用于配置用户分配标识的 UI。If options.hideUserAssignedIdentity is set to true, the UI to configure the user assigned identity isn't displayed. 没有为资源分配用户分配的标识。The resource isn't assigned a user assigned identity. 此选项的默认值为 falseThe default value for this option is false.

后续步骤Next steps