Microsoft.ManagedIdentity.IdentitySelector UI 元素

用于为部署中的资源分配托管标识的控件。

UI 示例

此控件由以下元素组成:

Microsoft.ManagedIdentity.IdentitySelector first step

当用户选择“添加” 时,将打开以下窗体。 用户可以为资源选择一个或多个用户分配的标识。

Microsoft.ManagedIdentity.IdentitySelector second step

所选的标识将显示在表中。 用户可以从此表中添加或删除项。

Microsoft.ManagedIdentity.IdentitySelector third step

架构

{
  "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
}

示例输出

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

备注

  • 使用 defaultValue.systemAssignedIdentity 为系统分配的标识选项控件设置初始值。 默认值为 Off。 允许以下值:

    • On � 系统分配的标识将分配给资源。
    • Off � 不会将系统分配的标识分配给资源。
    • OnOnly � 系统分配的标识将分配给资源。 在部署期间,用户无法编辑此值。
    • OffOnly � 不会将系统分配的标识分配给资源。 在部署期间,用户无法编辑此值。
  • 如果 options.hideSystemAssignedIdentity 设为 true,则不会显示用于配置系统分配标识的 UI。 此选项的默认值为 false

  • 如果 options.hideUserAssignedIdentity 设为 true,则不会显示用于配置用户分配标识的 UI。 没有为资源分配用户分配的标识。 此选项的默认值为 false

后续步骤