Aspire.Hosting.Azure.EventHubs 13.5.2

Prefix Reserved
dotnet add package Aspire.Hosting.Azure.EventHubs --version 13.5.2
                    
NuGet\Install-Package Aspire.Hosting.Azure.EventHubs -Version 13.5.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Aspire.Hosting.Azure.EventHubs" Version="13.5.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Aspire.Hosting.Azure.EventHubs" Version="13.5.2" />
                    
Directory.Packages.props
<PackageReference Include="Aspire.Hosting.Azure.EventHubs" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Aspire.Hosting.Azure.EventHubs --version 13.5.2
                    
#r "nuget: Aspire.Hosting.Azure.EventHubs, 13.5.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Aspire.Hosting.Azure.EventHubs@13.5.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Aspire.Hosting.Azure.EventHubs&version=13.5.2
                    
Install as a Cake Addin
#tool nuget:?package=Aspire.Hosting.Azure.EventHubs&version=13.5.2
                    
Install as a Cake Tool

Azure Event Hubs hosting integration

Use this integration to model, configure, and orchestrate Azure Event Hubs in an Aspire solution.

Getting started

Prerequisites

Add the integration

From your AppHost directory, add the Aspire.Hosting.Azure.EventHubs integration with the Aspire CLI:

aspire add Aspire.Hosting.Azure.EventHubs

Configure Azure Provisioning for local development

Adding Azure resources to the AppHost model will automatically enable development-time provisioning for Azure resources so that you don't need to configure them manually. Provisioning requires a number of settings to be available via AppHost configuration. From your AppHost directory, set these values with aspire secret set:

aspire secret set Azure:SubscriptionId "<your subscription id>"
aspire secret set Azure:ResourceGroupPrefix "<prefix for the resource group>"
aspire secret set Azure:Location "<azure location>"

NOTE: Developers must have Owner access to the target subscription so that role assignments can be configured for the provisioned resources.

Usage example

In the AppHost, add an Event Hubs connection and reference it from another resource with either C# or TypeScript:

C#

var eventHubs = builder.AddAzureEventHubs("eh");

var myService = builder.AddProject<Projects.MyService>()
                       .WithReference(eventHubs);

TypeScript

const eventHubs = await builder.addAzureEventHubs("eh");

const myService = await builder.addNodeApp("myService", "../my-service", "server.js")
                       .withReference(eventHubs);

Connection Properties

When you reference Azure Event Hubs resources using WithReference, the following connection properties are made available to the consuming project:

Event Hubs namespace

The Event Hubs namespace resource exposes the following connection properties:

Property Name Description
Host The hostname of the Event Hubs namespace
Port The port of the Event Hubs namespace when the emulator is used
Uri The connection URI for the Event Hubs namespace, with the format sb://myeventhubs.servicebus.windows.net on azure and sb://localhost:62824 for the emulator
ConnectionString Emulator only. Includes SAS key material for the local emulator connection.

Event Hub

The Event Hub resource inherits all properties from its parent Event Hubs namespace and adds:

Property Name Description
EventHubName The name of the event hub

Event Hub consumer group

The Event Hub consumer group resource inherits all properties from its parent Event Hub and adds:

Property Name Description
ConsumerGroupName The name of the consumer group

Aspire exposes each property as an environment variable named [RESOURCE]_[PROPERTY]. For instance, the Uri property of a resource called db1 becomes DB1_URI.

Additional documentation

Feedback & contributing

https://github.com/microsoft/aspire

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Aspire.Hosting.Azure.EventHubs:

Package Downloads
LupusBytes.Aspire.Hosting.Azure.EventHubs.LiveExplorer

Package Description

GitHub repositories (2)

Showing the top 2 popular GitHub repositories that depend on Aspire.Hosting.Azure.EventHubs:

Repository Stars
akkadotnet/Alpakka
Akka Streams Connectors - Alpakka
PacktPublishing/Pragmatic-Microservices-with-CSharp-and-Azure
Pragmatic Microservices with C# and Azure, published by Packt
Version Downloads Last Updated
13.5.2 415 8/21/2026
13.5.1 641 8/20/2026
13.5.0 938 8/18/2026
13.4.6 55,850 6/19/2026
13.4.5 4,801 6/17/2026
13.4.4 2,687 6/15/2026
13.4.3 6,761 6/8/2026
13.4.2 67,197 6/3/2026
13.4.1 474 6/3/2026
13.4.0 2,462 6/1/2026
13.3.5 30,286 5/21/2026
13.3.4 1,550 5/19/2026
13.3.3 4,125 5/15/2026
13.3.2 4,848 5/14/2026
13.3.1 2,381 5/12/2026
13.3.0 10,674 5/7/2026
13.2.4 22,115 4/24/2026
13.2.3 4,060 4/21/2026
13.2.2 14,163 4/8/2026
13.2.1 12,045 3/31/2026
Loading failed