Soenneker.ServiceBus.Admin
11.0.1732
Prefix Reserved
dotnet add package Soenneker.ServiceBus.Admin --version 11.0.1732
NuGet\Install-Package Soenneker.ServiceBus.Admin -Version 11.0.1732
<PackageReference Include="Soenneker.ServiceBus.Admin" Version="11.0.1732" />
<PackageVersion Include="Soenneker.ServiceBus.Admin" Version="11.0.1732" />
<PackageReference Include="Soenneker.ServiceBus.Admin" />
paket add Soenneker.ServiceBus.Admin --version 11.0.1732
#r "nuget: Soenneker.ServiceBus.Admin, 11.0.1732"
#:package Soenneker.ServiceBus.Admin@11.0.1732
#addin nuget:?package=Soenneker.ServiceBus.Admin&version=11.0.1732
#tool nuget:?package=Soenneker.ServiceBus.Admin&version=11.0.1732
Soenneker.ServiceBus.Admin
A lazily initialized, dependency-injection-friendly ServiceBusAdministrationClient for Azure Service Bus entity management.
Installation
dotnet add package Soenneker.ServiceBus.Admin
Configuration
Provide the Service Bus connection string at Azure:ServiceBus:ConnectionString:
{
"Azure": {
"ServiceBus": {
"ConnectionString": "Endpoint=sb://..."
}
}
}
Keep the connection string in a protected configuration provider rather than source control or client-visible configuration. Its credential must allow the administration operations your application performs.
Registration
using Soenneker.ServiceBus.Admin.Registrars;
services.AddServiceBusAdminUtilAsSingleton();
The client is created on the first Get call and reused until the service is disposed.
AddServiceBusAdminUtilAsScoped() exists, but this package's implementation currently registers the service as a singleton as well. Use AddServiceBusAdminUtilAsSingleton() when you want the lifetime to be unambiguous.
Usage
Inject IServiceBusAdminUtil, obtain the Azure SDK client, and use its administration APIs directly:
using Azure.Messaging.ServiceBus.Administration;
using Soenneker.ServiceBus.Admin.Abstract;
public sealed class QueueProvisioner(IServiceBusAdminUtil adminUtil)
{
public async Task EnsureQueue(CancellationToken cancellationToken)
{
ServiceBusAdministrationClient admin =
await adminUtil.Get(cancellationToken);
if (!(await admin.QueueExistsAsync("orders", cancellationToken)).Value)
{
await admin.CreateQueueAsync(
new CreateQueueOptions("orders")
{
MaxDeliveryCount = 10
},
cancellationToken);
}
}
}
The utility does not create queues, topics, subscriptions, or rules automatically. It only owns and reuses the configured administration client.
The Azure SDK client is safe to reuse. Do not dispose the object returned by Get; its lifetime belongs to IServiceBusAdminUtil and the DI container.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Azure.Messaging.ServiceBus (>= 7.21.0)
- Soenneker.Extensions.Configuration (>= 11.0.917)
- Soenneker.Utils.AsyncSingleton (>= 11.0.893)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.ServiceBus.Admin:
| Package | Downloads |
|---|---|
|
Soenneker.ServiceBus.Queue
A utility library for Azure Service queue operations |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.1732 | 661 | 11/11/2026 |
| 11.0.1731 | 256 | 11/11/2026 |
| 11.0.1730 | 196 | 11/11/2026 |
| 11.0.1729 | 68 | 11/11/2026 |
| 11.0.1728 | 82 | 11/11/2026 |
| 11.0.1727 | 270 | 11/10/2026 |
| 11.0.1726 | 76 | 11/10/2026 |
| 11.0.1725 | 2,149 | 11/3/2026 |
| 11.0.1724 | 1,137 | 10/27/2026 |
| 11.0.1723 | 569 | 10/26/2026 |
| 11.0.1722 | 246 | 10/26/2026 |
| 11.0.1721 | 197 | 10/26/2026 |
| 11.0.1720 | 314 | 10/26/2026 |
| 11.0.1719 | 341 | 10/26/2026 |
| 4.0.1718 | 414 | 10/26/2026 |
| 4.0.1717 | 105 | 10/25/2026 |
| 4.0.1716 | 1,489 | 10/15/2026 |
| 4.0.1715 | 125 | 10/15/2026 |
| 4.0.1714 | 103 | 10/15/2026 |
| 4.0.1712 | 139 | 10/14/2026 |
Updated Soenneker.Utils.AsyncSingleton to 11.0.893