分享方式:


Microsoft.ManagedIdentity.IdentitySelector UI 元素

此控制項是用來將受控識別指派給部署中的資源。

UI 範例

控制項由下列元素組成:

Microsoft.ManagedIdentity.IdentitySelector 第一個步驟

當使用者選取 [新增] 時,下列表單隨即開啟。 使用者可以為資源選取一個或多個使用者指派的身分識別。

Microsoft.ManagedIdentity.IdentitySelector 第二個步驟

選取的身分識別會顯示在表格中。 使用者可以從此表格新增或刪除項目。

Microsoft.ManagedIdentity.IdentitySelector 第三個步驟

結構描述

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

下一步