DKNet

Aspire.Hosting.ServiceBus

Utilities that light up Azure Service Bus inside a .NET Aspire AppHost. The package exposes strongly-typed resources, configuration conventions, and builder extensions to ensure your messaging topology is defined once and consumed consistently by DKNet services.

✨ Key Capabilities

🚀 Quick Start

var builder = DistributedApplication.CreateBuilder(args);

var serviceBus = builder.AddServiceBus("messaging", configure =>
{
    configure.WithNamespace("dknet-dev")
             .WithQueue("commands")
             .WithTopic("events");
});

var api = builder.AddProject<Projects.Api>("api");
api.WithReference(serviceBus);

builder.Build().Run();

The extension registers Azure Service Bus namespaces and ensures downstream projects automatically receive connection strings named according to the DKNet conventions.

⚙️ Configuration Options

ServiceBusResource exposes fluent methods to tailor the messaging topology:

All resources surface Aspire’s ResourceBuilder API so you can chain additional metadata (tags, env vars, replicas).

🧱 Integration Guidance

✅ Best Practices