你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Group User - Create
将现有用户添加到现有组
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/groups/{groupId}/users/{userId}?api-version=2022-08-01
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
group
|
path | True |
string |
组标识符。 在当前API 管理服务实例中必须是唯一的。 |
resource
|
path | True |
string |
资源组的名称。 此名称不区分大小写。 |
service
|
path | True |
string |
API 管理服务的名称。 正则表达式模式: |
subscription
|
path | True |
string |
目标订阅的 ID。 |
user
|
path | True |
string |
用户标识符。 在当前API 管理服务实例中必须是唯一的。 |
api-version
|
query | True |
string |
要用于此操作的 API 版本。 |
响应
名称 | 类型 | 说明 |
---|---|---|
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 | 模拟用户帐户 |
示例
ApiManagementCreateGroupUser
示例请求
示例响应
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/59307d350af58404d8a26300",
"type": "Microsoft.ApiManagement/service/groups/users",
"name": "59307d350af58404d8a26300",
"properties": {
"firstName": "test",
"lastName": "user",
"email": "testuser1@live.com",
"state": "active",
"registrationDate": "2017-06-01T20:46:45.437Z",
"groups": [],
"identities": []
}
}
{
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/59307d350af58404d8a26300",
"type": "Microsoft.ApiManagement/service/groups/users",
"name": "59307d350af58404d8a26300",
"properties": {
"firstName": "test",
"lastName": "user",
"email": "testuser1@live.com",
"state": "active",
"registrationDate": "2017-06-01T20:46:45.437Z",
"groups": [],
"identities": []
}
}
定义
名称 | 说明 |
---|---|
Error |
错误字段协定。 |
Error |
错误响应。 |
Group |
组协定属性。 |
Group |
组类型。 |
User |
用户详细信息。 |
User |
用户标识详细信息。 |
User |
帐户状态。 指定用户是否处于活动状态。 被阻止的用户无法登录开发人员门户或调用已订阅产品的任何 API。 默认状态为“活动”。 |
ErrorFieldContract
错误字段协定。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
属性级错误代码。 |
message |
string |
属性级错误的可读表示形式。 |
target |
string |
属性名称。 |
ErrorResponse
错误响应。
名称 | 类型 | 说明 |
---|---|---|
error.code |
string |
服务定义的错误代码。 此代码用作响应中指定的 HTTP 错误代码的子状态。 |
error.details |
在发生验证错误的情况下,在请求中发送的无效字段列表。 |
|
error.message |
string |
错误的用户可读表示形式。 |
GroupContractProperties
组协定属性。
名称 | 类型 | 说明 |
---|---|---|
builtIn |
boolean |
如果组是管理员、开发人员或来宾) (三个系统组之一,则为 true;否则为 false。 |
description |
string |
组说明。 可以包含采用 HTML 格式的标记。 |
displayName |
string |
组名称。 |
externalId |
string |
对于外部组,此属性包含来自外部标识提供者(例如 Azure Active Directory |
type |
组类型。 |
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 |
用户所属的组集合。 |
||
properties.identities |
用户标识的集合。 |
||
properties.lastName |
string |
姓氏。 |
|
properties.note |
string |
有关管理员设置的用户的可选备注。 |
|
properties.registrationDate |
string |
用户注册的日期。 日期符合以下格式: |
|
properties.state | 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 |
用户帐户处于挂起状态。 需要标识确认才能激活。 |