ServiceBusEmulatorConfig.Cli 1.1.0

dotnet tool install --global ServiceBusEmulatorConfig.Cli --version 1.1.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local ServiceBusEmulatorConfig.Cli --version 1.1.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=ServiceBusEmulatorConfig.Cli&version=1.1.0
                    
nuke :add-package ServiceBusEmulatorConfig.Cli --version 1.1.0
                    

Tools to work efficiently with the Azure Service Bus [Emulator] (Work in progress)

Features

  • Convert Azure Service Bus Namespace ARM template to Azure Service Bus emulator configuration.
  • Inspect Azure Service Bus Namespace
    • See Topic, subscriptions and rules
    • See Queues

Next features

  • Peak messages
  • Send messages

The tool

Install the NuGet.org version as: $ dotnet tool install --global ServiceBusEmulatorConfig.Cli, it is invoked by $ sbconfig.

Install, or update, from source:

  1. $ pushd ServiceBusEmulatorConfig.Cli
  2. $ dotnet pack -c Release -p:PackageVersion 1.0.1
  3. $ dotnet tool install -g SerbiceBusEumlatorConfig.Cli --add-source nupkg/

ARM to emulator config

The ARM template must be manually downloaded or compiled using $ az bicep build --file <bicep.bicep>

$ sbconfig transform --help
Description:
  Transform Azure Service Bus ARM template to Emulator config

Usage:
  ServiceBusEmulatorConfig.Cli transform [options]

Options:
  -i, --input <input> (REQUIRED)    Path to the ARM template JSON file
  -o, --output <output> (REQUIRED)  Path to save the generated emulator config file
  -n, --namespace <namespace>       The namespace name to use in the emulator config [default: sbemulatorns]
  -?, -h, --help                    Show help and usage information
Aspire usage

Mount the config file:

var serviceBus = builder
    .AddAzureServiceBus("esb")
    .RunAsEmulator(em =>
    {
        em.WithBindMount("Config.json", "/ServiceBus_Emulator/ConfigFiles/Config.json");
    });

NB: This runs as docker, so the Config.json must be at the root, or below, of the Aspire project.

Docker usage

Given the example from Microsoft, specify the path to the outputted Config.json in the .env file. Remember, rhis runs as docker, so the Config.json must be at the root, or below, of the Aspire project.

Inspect Azure Service Bus Namespace

Until Azure/azure-service-bus-emulator-installer/issues/17 have been resolved, we cannot use the explorer (or any viwer) for the emulator...

But the explorer is cross platform, and can be launched as $ sbconfig explorer.

This launched as local web api and the explorer is simply a webinterface - crossplatform without hazzle 😃

For now, the repo must be cloned and executed manually.

Contribute

Feel free to open an issue or PR! 🚀

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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.

This package has no dependencies.

Version Downloads Last Updated
1.1.0 100 5/24/2025
0.1.0-beta0001 150 5/18/2025
0.0.1-rc.1 70 5/24/2025