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=2026-11-01

URI Parameters

Name In Required Type Description
eventHubEndpointName
path True

string

The name of the EventHubEndpoint

name
path True

string

The name of the consumer group to retrieve.

resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

resourceName
path True

string

The name of the IoT hub.

subscriptionId
path True

string (uuid)

The ID of the target subscription. The value must be an UUID.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Request Body

Name Required Type Description
properties True

EventHubConsumerGroupName

The EventHub consumer group name.

Responses

Name Type Description
200 OK

EventHubConsumerGroupInfo

Resource 'EventHubConsumerGroupInfo' update operation succeeded

Other Status Codes

ErrorDetails

An unexpected error response.

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=2026-11-01

{
  "properties": {
    "name": "test"
  }
}

Sample response

{
  "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"
  }
}

Definitions

Name Description
createdByType

The type of identity that created the resource.

ErrorDetails

Error details.

EventHubConsumerGroupBodyDescription

The EventHub consumer group.

EventHubConsumerGroupInfo

The properties of the EventHubConsumerGroupInfo object.

EventHubConsumerGroupName

The EventHub consumer group name.

systemData

Metadata pertaining to creation and last modification of the resource.

createdByType

The type of identity that created the resource.

Value Description
User
Application
ManagedIdentity
Key

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

EventHubConsumerGroupName

The EventHub consumer group name.

EventHubConsumerGroupInfo

The properties of the EventHubConsumerGroupInfo object.

Name Type Description
etag

string

The etag.

id

string (arm-id)

Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"

name

string

The name of the resource

properties

management.azure.com.iothub.iothubresource.createeventhubconsumergroup

The tags.

systemData

systemData

Azure Resource Manager metadata containing createdBy and modifiedBy information.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

EventHubConsumerGroupName

The EventHub consumer group name.

Name Type Description
name

string

EventHub consumer group name

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string (date-time)

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string (date-time)

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.