你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

User - Update

汇报标识符指定的用户的详细信息。

PATCH https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/users/{userId}?api-version=2022-08-01

URI 参数

名称 必需 类型 说明
resourceGroupName
path True

string

资源组的名称。 此名称不区分大小写。

serviceName
path True

string

API 管理服务的名称。

Regex pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$

subscriptionId
path True

string

目标订阅的 ID。

userId
path True

string

用户标识符。 在当前API 管理服务实例中必须是唯一的。

api-version
query True

string

要用于此操作的 API 版本。

请求头

名称 必需 类型 说明
If-Match True

string

实体的 ETag。 ETag 应与 GET 请求的标头响应中的当前实体状态匹配,或者对于无条件更新,ETag 应为 * 。

请求正文

名称 类型 说明
properties.email

string

电子邮件地址。 不得为空,且必须在服务实例中唯一。

properties.firstName

string

名字。

properties.identities

UserIdentityContract[]

用户标识的集合。

properties.lastName

string

姓氏。

properties.note

string

有关管理员设置的用户的可选备注。

properties.password

string

用户密码。

properties.state

UserState

帐户状态。 指定用户是否处于活动状态。 被阻止的用户无法登录开发人员门户或调用已订阅产品的任何 API。 默认状态为“活动”。

响应

名称 类型 说明
200 OK

UserContract

已成功更新用户。

Headers

ETag: string

Other Status Codes

ErrorResponse

描述操作失败原因的错误响应。

安全性

azure_auth

Azure Active Directory OAuth2 流。

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

名称 说明
user_impersonation 模拟用户帐户

示例

ApiManagementUpdateUser

Sample Request

PATCH https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/5931a75ae4bbd512a88c680b?api-version=2022-08-01


{
  "properties": {
    "firstName": "foo",
    "lastName": "bar",
    "email": "foobar@outlook.com"
  }
}

Sample Response

{
  "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/5931a75ae4bbd512a88c680b",
  "type": "Microsoft.ApiManagement/service/users",
  "name": "5931a75ae4bbd512a88c680b",
  "properties": {
    "firstName": "foo",
    "lastName": "bar",
    "email": "foobar@outlook.com",
    "state": "active",
    "registrationDate": "2017-06-02T17:58:50.357Z",
    "identities": [
      {
        "provider": "Microsoft",
        "id": "*************"
      }
    ]
  }
}

定义

名称 说明
ErrorFieldContract

错误字段协定。

ErrorResponse

错误响应。

GroupContractProperties

组协定属性。

GroupType

组类型。

UserContract

用户详细信息。

UserIdentityContract

用户标识详细信息。

UserState

帐户状态。 指定用户是否处于活动状态。 被阻止的用户无法登录开发人员门户或调用已订阅产品的任何 API。 默认状态为“活动”。

UserUpdateParameters

用户更新参数。

ErrorFieldContract

错误字段协定。

名称 类型 说明
code

string

属性级错误代码。

message

string

属性级错误的可读表示形式。

target

string

属性名称。

ErrorResponse

错误响应。

名称 类型 说明
error.code

string

服务定义的错误代码。 此代码用作响应中指定的 HTTP 错误代码的子状态。

error.details

ErrorFieldContract[]

在发生验证错误时,请求中发送的无效字段列表。

error.message

string

错误的用户可读表示形式。

GroupContractProperties

组协定属性。

名称 类型 说明
builtIn

boolean

如果组是管理员、开发人员或来宾) (三个系统组之一,则为 true;否则为 false。

description

string

组说明。 可以包含采用 HTML 格式的标记。

displayName

string

组名称。

externalId

string

对于外部组,此属性包含来自外部标识提供者的组 ID,例如 Azure Active Directory aad://<tenant>.onmicrosoft.com/groups/<group object id>;否则值为 null。

type

GroupType

组类型。

GroupType

组类型。

名称 类型 说明
custom

string

external

string

system

string

UserContract

用户详细信息。

名称 类型 默认值 说明
id

string

资源的完全限定的资源 ID。 例如 - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}

name

string

资源的名称

properties.email

string

电子邮件地址。

properties.firstName

string

名字。

properties.groups

GroupContractProperties[]

用户所属的组集合。

properties.identities

UserIdentityContract[]

用户标识的集合。

properties.lastName

string

姓氏。

properties.note

string

有关管理员设置的用户的可选备注。

properties.registrationDate

string

用户注册的日期。 日期符合以下格式: yyyy-MM-ddTHH:mm:ssZ 由 ISO 8601 标准指定。

properties.state

UserState

active

帐户状态。 指定用户是否处于活动状态。 被阻止的用户无法登录开发人员门户或调用已订阅产品的任何 API。 默认状态为“活动”。

type

string

资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts”

UserIdentityContract

用户标识详细信息。

名称 类型 说明
id

string

提供程序中的标识符值。

provider

string

标识提供者名称。

UserState

帐户状态。 指定用户是否处于活动状态。 被阻止的用户无法登录开发人员门户或调用已订阅产品的任何 API。 默认状态为“活动”。

名称 类型 说明
active

string

用户状态为活动状态。

blocked

string

用户被阻止。 被阻止的用户无法在开发人员门户或调用 API 进行身份验证。

deleted

string

用户帐户已关闭。 删除所有标识和相关实体。

pending

string

用户帐户处于挂起状态。 需要标识确认,然后才能激活它。

UserUpdateParameters

用户更新参数。

名称 类型 默认值 说明
properties.email

string

电子邮件地址。 不得为空,且必须在服务实例中唯一。

properties.firstName

string

名字。

properties.identities

UserIdentityContract[]

用户标识的集合。

properties.lastName

string

姓氏。

properties.note

string

有关管理员设置的用户的可选备注。

properties.password

string

用户密码。

properties.state

UserState

active

帐户状态。 指定用户是否处于活动状态。 被阻止的用户无法登录开发人员门户或调用已订阅产品的任何 API。 默认状态为“活动”。