# AzureEventHubResource

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

## Definition

```typescript
interface AzureEventHubResource
  extends IExpressionValue,
    IManifestExpressionProvider,
    IResource,
    IResourceWithConnectionString,
    IResourceWithParent,
    AzureEventHubsResource]],
    IValueProvider,
    IValueWithReferences,
    IResourceWithAzureFunctionsConfig {
  readonly connectionStringExpression: ReferenceExpression;
  hubName: string;
  readonly parent: AzureEventHubsResource;
  partitionCount: number;
  addConsumerGroup(
      name: string,
      groupName?: string): AzureEventHubConsumerGroupResource;
  withProperties(configure: (obj: AzureEventHubResource) => Promise<void>): AzureEventHubResource;
}
```

## Properties

- `connectionStringExpression`: `ReferenceExpression` `get` -- Gets the ConnectionStringExpression property
- `hubName`: `string` `get - set` -- Gets the HubName property
- `parent`: [AzureEventHubsResource](/reference/api/typescript/aspire.hosting.azure.eventhubs/azureeventhubsresource.md) `get` -- Gets the Parent property
- `partitionCount`: `number` `get - set` -- Gets the PartitionCount property

## Methods

- [addConsumerGroup](/reference/api/typescript/aspire.hosting.azure.eventhubs/azureeventhubresource/addconsumergroup.md) -- `method` -- Adds an Azure Event Hub consumer group resource
    ```typescript
  addConsumerGroup(name: string, groupName?: string): AzureEventHubConsumerGroupResource
  ```
- [withProperties](/reference/api/typescript/aspire.hosting.azure.eventhubs/azureeventhubresource/withproperties.md) -- `method` -- Configures properties of an Azure Event Hub
    ```typescript
  withProperties(configure: (obj: AzureEventHubResource) => Promise<void>): AzureEventHubResource
  ```
