# AzureEventHubResource

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

Represents an Azure Event Hub. Initializes a new instance of the {@ats-ref type:AzureEventHubResource} class.

## 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 connection string expression for the Azure Event Hub.
- `hubName`: `string` `get - set` -- The event hub name.
- `parent`: [AzureEventHubsResource](/reference/api/typescript/aspire.hosting.azure.eventhubs/azureeventhubsresource.md) `get` -- Gets the parent Azure Event Hubs resource.
- `partitionCount`: `number` `get - set` -- Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions.

## Methods

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