Iot Hub Resource - Create Event Hub Consumer Group
将使用者组添加到 IoT 中心中与事件中心兼容的终结点。
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}?api-version=2026-11-01
URI 参数
| 名称 | 在 | 必需 | 类型 | 说明 |
|---|---|---|---|---|
|
event
|
path | True |
string |
EventHubEndpoint的名称 |
|
name
|
path | True |
string |
要检索的使用者组的名称。 |
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 此名称不区分大小写。 |
|
resource
|
path | True |
string |
IoT 中心的名称。 |
|
subscription
|
path | True |
string (uuid) |
目标订阅的 ID。 该值必须是 UUID。 |
|
api-version
|
query | True |
string minLength: 1 |
用于此操作的 API 版本。 |
请求正文
| 名称 | 必需 | 类型 | 说明 |
|---|---|---|---|
| properties | True |
EventHub 使用者组名称。 |
响应
| 名称 | 类型 | 说明 |
|---|---|---|
| 200 OK |
资源“EventHubConsumerGroupInfo”更新操作成功 |
|
| Other Status Codes |
未预期的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 流程。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
| 名称 | 说明 |
|---|---|
| user_impersonation | 冒充您的用户账户 |
示例
IotHubResource_CreateEventHubConsumerGroup
示例请求
PUT https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub/eventHubEndpoints/events/ConsumerGroups/test?api-version=2026-11-01
{
"properties": {
"name": "test"
}
}
示例响应
{
"name": "test",
"type": "Microsoft.Devices/IotHubs/EventHubEndpoints/ConsumerGroups",
"etag": "AAAAAAFD6M4=",
"id": "/subscriptions/cmd-sub-1/resourceGroups/cmd-rg-1/providers/Microsoft.Devices/IotHubs/test-hub-2/eventHubEndpoints/events/ConsumerGroups/%24Default",
"properties": {
"created": "Thu, 15 Jun 2017 19:20:58 GMT"
}
}
定义
| 名称 | 说明 |
|---|---|
|
created |
创建该资源的身份类型。 |
|
Error |
错误详细信息。 |
|
Event |
EventHub 使用者组。 |
|
Event |
EventHubConsumerGroupInfo 对象的属性。 |
|
Event |
EventHub 使用者组名称。 |
|
system |
与创建和上次修改资源相关的元数据。 |
createdByType
创建该资源的身份类型。
| 值 | 说明 |
|---|---|
| User | |
| Application | |
| ManagedIdentity | |
| Key |
ErrorDetails
错误详细信息。
| 名称 | 类型 | 说明 |
|---|---|---|
| code |
string |
错误代码。 |
| details |
string |
错误详情。 |
| httpStatusCode |
string |
HTTP 状态代码。 |
| message |
string |
错误消息。 |
EventHubConsumerGroupBodyDescription
EventHub 使用者组。
| 名称 | 类型 | 说明 |
|---|---|---|
| properties |
EventHub 使用者组名称。 |
EventHubConsumerGroupInfo
EventHubConsumerGroupInfo 对象的属性。
| 名称 | 类型 | 说明 |
|---|---|---|
| etag |
string |
etag. |
| id |
string (arm-id) |
该资源的完全限定资源 ID。 例如,“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}” |
| name |
string |
资源的名称 |
| properties |
标记。 |
|
| systemData |
包含 createdBy 和 modifiedBy 信息的 Azure 资源管理器元数据。 |
|
| type |
string |
资源类型。 例如“Microsoft.Compute/virtualMachines”或“Microsoft.Storage/storageAccounts” |
EventHubConsumerGroupName
EventHub 使用者组名称。
| 名称 | 类型 | 说明 |
|---|---|---|
| name |
string |
EventHub 使用者组名称 |
systemData
与创建和上次修改资源相关的元数据。
| 名称 | 类型 | 说明 |
|---|---|---|
| createdAt |
string (date-time) |
资源创建时间戳(UTC)。 |
| createdBy |
string |
创建该资源的身份。 |
| createdByType |
创建该资源的身份类型。 |
|
| lastModifiedAt |
string (date-time) |
上次修改的资源时间戳(UTC) |
| lastModifiedBy |
string |
上次修改资源的标识。 |
| lastModifiedByType |
上次修改资源的标识的类型。 |