# addConsumerGroup

- Module: [Aspire.Hosting.Azure.EventHubs](/reference/api/typescript/aspire.hosting.azure.eventhubs.md)
- Version: `13.4.0`
- Kind: `method`
- Source: [GitHub](https://github.com/microsoft/aspire)

Adds an Azure Event Hub Consumer Group resource to the application model.

## Definition

```typescript
interface AzureEventHubResource {
  // ... omitted for brevity
  addConsumerGroup(
    name: string,
    groupName?: string): AzureEventHubConsumerGroupResource
}
```

## Parameters

- `name` (`string`)
- `groupName` (`string`) `optional`

## Returns

[AzureEventHubConsumerGroupResource](/reference/api/typescript/aspire.hosting.azure.eventhubs/azureeventhubconsumergroupresource.md) `builder`

## Applies to

- [AzureEventHubResource](/reference/api/typescript/aspire.hosting.azure.eventhubs/azureeventhubresource.md)
