User Assigned Identities - Create Or Update
在指定的訂用帳戶和資源群組中建立或更新身分識別。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{resourceName}?api-version=2024-11-30
URI 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
resource
|
path | True |
string |
身分識別所屬的資源群組名稱。 |
resource
|
path | True |
string |
識別資源的名稱。 |
subscription
|
path | True |
string |
身分識別所屬的訂用帳戶標識碼。 |
api-version
|
query | True |
string |
要叫用的 API 版本。 |
要求本文
名稱 | 必要 | 類型 | Description |
---|---|---|---|
location | True |
string |
資源所在的地理位置 |
properties.isolationScope |
列舉,視需要設定身分識別指派的區域限制。 |
||
tags |
object |
資源標籤。 |
回應
名稱 | 類型 | Description |
---|---|---|
200 OK |
更新的身分識別 |
|
201 Created |
已建立的身分識別 |
|
Other Status Codes |
描述作業失敗原因的錯誤回應。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow
類型:
oauth2
Flow:
implicit
授權 URL:
https://login.microsoftonline.com/common/oauth2/authorize
範圍
名稱 | Description |
---|---|
user_impersonation | 模擬您的用戶帳戶 |
範例
IdentityCreate
範例要求
PUT https://management.azure.com/subscriptions/subid/resourceGroups/rgName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/resourceName?api-version=2024-11-30
{
"location": "eastus",
"tags": {
"key1": "value1",
"key2": "value2"
}
}
範例回覆
{
"id": "/subscriptions/subid/resourcegroups/rgName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName",
"location": "eastus",
"name": "identityName",
"properties": {
"clientId": "4024ab25-56a8-4370-aea6-6389221caf29",
"principalId": "25cc773c-7f05-40fc-a104-32d2300754ad",
"tenantId": "b6c948ef-f6b5-4384-8354-da3a15eca969",
"isolationScope": "None"
},
"tags": {
"key1": "value1",
"key2": "value2"
},
"type": "Microsoft.ManagedIdentity/userAssignedIdentities"
}
{
"id": "/subscriptions/subid/resourcegroups/rgName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName",
"location": "eastus",
"name": "identityName",
"properties": {
"clientId": "4024ab25-56a8-4370-aea6-6389221caf29",
"principalId": "25cc773c-7f05-40fc-a104-32d2300754ad",
"tenantId": "b6c948ef-f6b5-4384-8354-da3a15eca969",
"isolationScope": "None"
},
"tags": {
"key1": "value1",
"key2": "value2"
},
"type": "Microsoft.ManagedIdentity/userAssignedIdentities"
}
定義
名稱 | Description |
---|---|
Cloud |
ManagedServiceIdentity 服務的錯誤回應。 |
Cloud |
ManagedServiceIdentity 服務的錯誤回應。 |
created |
建立資源的身分識別類型。 |
Identity |
描述身分識別資源。 |
isolation |
列舉,視需要設定身分識別指派的區域限制。 |
system |
與建立和上次修改資源相關的元數據。 |
CloudError
ManagedServiceIdentity 服務的錯誤回應。
名稱 | 類型 | Description |
---|---|---|
error |
錯誤的其他詳細數據清單。 |
CloudErrorBody
ManagedServiceIdentity 服務的錯誤回應。
名稱 | 類型 | Description |
---|---|---|
code |
string |
錯誤的識別碼。 |
details |
錯誤的其他詳細數據清單。 |
|
message |
string |
描述錯誤的訊息,適用於在使用者介面中顯示。 |
target |
string |
特定錯誤的目標。 例如,錯誤中的屬性名稱。 |
createdByType
建立資源的身分識別類型。
名稱 | 類型 | Description |
---|---|---|
Application |
string |
|
Key |
string |
|
ManagedIdentity |
string |
|
User |
string |
Identity
描述身分識別資源。
名稱 | 類型 | Description |
---|---|---|
id |
string |
資源的完整資源標識碼。 例如 “/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}” |
location |
string |
資源所在的地理位置 |
name |
string |
資源的名稱 |
properties.clientId |
string |
與身分識別相關聯的應用程式識別碼。 這是 MSI 產生的隨機 UUID。 |
properties.isolationScope |
列舉,視需要設定身分識別指派的區域限制。 |
|
properties.principalId |
string |
與建立的身分識別相關聯的服務主體對象的標識碼。 |
properties.tenantId |
string |
身分識別所屬租用戶的標識碼。 |
systemData |
包含 createdBy 和 modifiedBy 資訊的 Azure Resource Manager 元數據。 |
|
tags |
object |
資源標籤。 |
type |
string |
資源的型別。 例如“Microsoft.Compute/virtualMachines” 或 “Microsoft.Storage/storageAccounts” |
isolationScope
列舉,視需要設定身分識別指派的區域限制。
名稱 | 類型 | Description |
---|---|---|
None |
string |
|
Regional |
string |
systemData
與建立和上次修改資源相關的元數據。
名稱 | 類型 | Description |
---|---|---|
createdAt |
string |
資源建立的時間戳(UTC)。 |
createdBy |
string |
建立資源的身分識別。 |
createdByType |
建立資源的身分識別類型。 |
|
lastModifiedAt |
string |
上次修改的資源時間戳 (UTC) |
lastModifiedBy |
string |
上次修改資源的身分識別。 |
lastModifiedByType |
上次修改資源的身分識別類型。 |