Microsoft.ManagedIdentity.IdentitySelector UI 元素
此控制項是用來將受控識別指派給部署中的資源。
UI 範例
控制項由下列元素組成:
當使用者選取 [新增] 時,下列表單隨即開啟。 使用者可以為資源選取一個或多個使用者指派的身分識別。
選取的身分識別會顯示在表格中。 使用者可以從此表格新增或刪除項目。
結構描述
{
"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。
下一步
- 如需建立 UI 定義的簡介,請參閱開始使用 CreateUiDefinition。
- 如需 UI 元素中通用屬性的說明,請參閱 CreateUiDefinition 元素。