# AzureEventHubResource

- Kind: `class`
- Package: [Aspire.Hosting.Azure.EventHubs](/reference/api/csharp/aspire.hosting.azure.eventhubs.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting.Azure`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.EventHubs/AzureEventHubResource.cs)
- Inherits: `Resource`
- Implements: `IExpressionValue`, `IManifestExpressionProvider`, `IResource`, `IResourceWithConnectionString`, `IResourceWithParent`, `IResourceWithParent<AzureEventHubsResource>`, `IValueProvider`, `IValueWithReferences`, `IResourceWithAzureFunctionsConfig`

Represents an Azure Event Hub. Initializes a new instance of the [AzureEventHubResource](/reference/api/csharp/aspire.hosting.azure.eventhubs/azureeventhubresource.md) class.

## Definition

```csharp
namespace Aspire.Hosting.Azure;

public class AzureEventHubResource
    : Aspire.Hosting.ApplicationModel.Resource,
      Aspire.Hosting.ApplicationModel.IExpressionValue,
      Aspire.Hosting.ApplicationModel.IManifestExpressionProvider,
      Aspire.Hosting.ApplicationModel.IResource,
      Aspire.Hosting.ApplicationModel.IResourceWithConnectionString,
      Aspire.Hosting.ApplicationModel.IResourceWithParent,
      Aspire.Hosting.ApplicationModel.IResourceWithParent<Aspire.Hosting.Azure.AzureEventHubsResource>,
      Aspire.Hosting.ApplicationModel.IValueProvider,
      Aspire.Hosting.ApplicationModel.IValueWithReferences,
      Aspire.Hosting.Azure.IResourceWithAzureFunctionsConfig
{
    // ...
}
```

## ATS metadata

### ATS export

- Type ID: `Aspire.Hosting.Azure.EventHubs/AzureEventHubResource`

## Remarks

Use `AzureProvisioningResourceExtensions.ConfigureInfrastructure` to configure specific `Azure.Provisioning` properties.

## Constructors

- [AzureEventHubResource(string, string, AzureEventHubsResource)](/reference/api/csharp/aspire.hosting.azure.eventhubs/azureeventhubresource/constructors.md#constructor-string-string-azureeventhubsresource) -- Represents an Azure Event Hub. Initializes a new instance of the [AzureEventHubResource](/reference/api/csharp/aspire.hosting.azure.eventhubs/azureeventhubresource.md) class.

## Properties

- [ConnectionStringExpression](/reference/api/csharp/aspire.hosting.azure.eventhubs/azureeventhubresource/properties.md#connectionstringexpression) : `ReferenceExpression` `get` -- Gets the connection string expression for the Azure Event Hub.
- [HubName](/reference/api/csharp/aspire.hosting.azure.eventhubs/azureeventhubresource/properties.md#hubname) : `string` `get; set` -- The event hub name.
- [Parent](/reference/api/csharp/aspire.hosting.azure.eventhubs/azureeventhubresource/properties.md#parent) : [AzureEventHubsResource](/reference/api/csharp/aspire.hosting.azure.eventhubs/azureeventhubsresource.md) `get` -- Gets the parent Azure Event Hubs resource.
- [PartitionCount](/reference/api/csharp/aspire.hosting.azure.eventhubs/azureeventhubresource/properties.md#partitioncount) : `long?` `get; set` -- Number of partitions created for the Event Hub, allowed values are from 1 to 32 partitions.
