Iot Hub Resource - Create Event Hub Consumer Group
Add a consumer group to an Event Hub-compatible endpoint in an IoT hub.
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}?api-version=2023-06-30URI Parameters
| Name | In | Required | Type | Description | 
|---|---|---|---|---|
| event | path | True | string | The name of the Event Hub-compatible endpoint in the IoT hub. | 
| name | path | True | string | The name of the consumer group to add. | 
| resource | path | True | string | The name of the resource group that contains the IoT hub. | 
| resource | path | True | string | The name of the IoT hub. | 
| subscription | path | True | string | The subscription identifier. | 
| api-version | query | True | string | The version of the API. | 
Request Body
| Name | Required | Type | Description | 
|---|---|---|---|
| properties | True | The EventHub consumer group name. | 
Responses
| Name | Type | Description | 
|---|---|---|
| 200 OK | This is a synchronous operation. | |
| Other Status Codes | DefaultErrorResponse | 
Security
azure_auth
Azure Active Directory OAuth2 Flow
					Type: 
					oauth2
					Flow: 
					implicit
					Authorization URL: 
					https://login.microsoftonline.com/common/oauth2/authorize
			
Scopes
| Name | Description | 
|---|---|
| user_impersonation | impersonate your user account | 
Examples
IotHubResource_CreateEventHubConsumerGroup      
			Sample request
PUT https://management.azure.com/subscriptions/91d12660-3dec-467a-be2a-213b5544ddc0/resourceGroups/myResourceGroup/providers/Microsoft.Devices/IotHubs/testHub/eventHubEndpoints/events/ConsumerGroups/test?api-version=2023-06-30
{
  "properties": {
    "name": "test"
  }
}
Sample response
{
  "properties": {
    "created": "Thu, 15 Jun 2017 19:20:58 GMT"
  },
  "id": "/subscriptions/cmd-sub-1/resourceGroups/cmd-rg-1/providers/Microsoft.Devices/IotHubs/test-hub-2/eventHubEndpoints/events/ConsumerGroups/%24Default",
  "name": "test",
  "type": "Microsoft.Devices/IotHubs/EventHubEndpoints/ConsumerGroups",
  "etag": "AAAAAAFD6M4="
}Definitions
| Name | Description | 
|---|---|
| Error | Error details. | 
| Event | The EventHub consumer group. | 
| Event | The properties of the EventHubConsumerGroupInfo object. | 
| Event | The EventHub consumer group name. | 
ErrorDetails 
			
			Error details.
| Name | Type | Description | 
|---|---|---|
| code | string | The error code. | 
| details | string | The error details. | 
| httpStatusCode | string | The HTTP status code. | 
| message | string | The error message. | 
EventHubConsumerGroupBodyDescription     
			
			The EventHub consumer group.
| Name | Type | Description | 
|---|---|---|
| properties | The EventHub consumer group name. | 
EventHubConsumerGroupInfo    
			
			The properties of the EventHubConsumerGroupInfo object.
| Name | Type | Description | 
|---|---|---|
| etag | string | The etag. | 
| id | string | The Event Hub-compatible consumer group identifier. | 
| name | string | The Event Hub-compatible consumer group name. | 
| properties | 
 | The tags. | 
| type | string | the resource type. | 
EventHubConsumerGroupName    
			
			The EventHub consumer group name.
| Name | Type | Description | 
|---|---|---|
| name | string | EventHub consumer group name |