你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
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 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
resource
|
path | True |
string |
标识所属的资源组的名称。 |
resource
|
path | True |
string |
标识资源的名称。 |
subscription
|
path | True |
string |
标识所属的订阅的 ID。 |
api-version
|
query | True |
string |
要调用的 API 版本。 |
请求正文
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
location | True |
string |
资源所在的地理位置 |
properties.isolationScope |
根据需要配置标识分配的区域限制的枚举。 |
||
tags |
object |
资源标记。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
更新的标识 |
|
201 Created |
已创建标识 |
|
Other Status Codes |
描述操作失败的原因的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
名称 | 说明 |
---|---|
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"
}
定义
名称 | 说明 |
---|---|
Cloud |
ManagedServiceIdentity 服务的错误响应。 |
Cloud |
ManagedServiceIdentity 服务的错误响应。 |
created |
创建资源的标识的类型。 |
Identity |
描述标识资源。 |
isolation |
根据需要配置标识分配的区域限制的枚举。 |
system |
与创建和上次修改资源相关的元数据。 |
CloudError
ManagedServiceIdentity 服务的错误响应。
名称 | 类型 | 说明 |
---|---|---|
error |
有关错误的其他详细信息的列表。 |
CloudErrorBody
ManagedServiceIdentity 服务的错误响应。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
错误的标识符。 |
details |
有关错误的其他详细信息的列表。 |
|
message |
string |
描述错误的消息,旨在适合在用户界面中显示。 |
target |
string |
特定错误的目标。 例如,错误属性的名称。 |
createdByType
创建资源的标识的类型。
名称 | 类型 | 说明 |
---|---|---|
Application |
string |
|
Key |
string |
|
ManagedIdentity |
string |
|
User |
string |
Identity
描述标识资源。
名称 | 类型 | 说明 |
---|---|---|
id |
string |
资源的完全限定资源 ID。 例如“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}” |
location |
string |
资源所在的地理位置 |
name |
string |
资源的名称 |
properties.clientId |
string |
与标识关联的应用的 ID。 这是 MSI 随机生成的 UUID。 |
properties.isolationScope |
根据需要配置标识分配的区域限制的枚举。 |
|
properties.principalId |
string |
与创建的标识关联的服务主体对象的 ID。 |
properties.tenantId |
string |
标识所属的租户的 ID。 |
systemData |
包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。 |
|
tags |
object |
资源标记。 |
type |
string |
资源的类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts” |
isolationScope
根据需要配置标识分配的区域限制的枚举。
名称 | 类型 | 说明 |
---|---|---|
None |
string |
|
Regional |
string |
systemData
与创建和上次修改资源相关的元数据。
名称 | 类型 | 说明 |
---|---|---|
createdAt |
string |
资源创建时间戳(UTC)。 |
createdBy |
string |
创建资源的标识。 |
createdByType |
创建资源的标识的类型。 |
|
lastModifiedAt |
string |
上次修改的资源时间戳(UTC) |
lastModifiedBy |
string |
上次修改资源的标识。 |
lastModifiedByType |
上次修改资源的标识的类型。 |