microsoft / microsoft/aspire

Service Bus Emulator 2.0.0 integration should expose admin connection string

Open
#14,041 2 comments 5 reactions 0 assignees View on GitHub
area-integrations
Dominant language
C#
Stars
6.3k
Forks
991
Avg merge
2d 12h
Merged PRs (30d)
201

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Is your feature request related to a problem? Please describe the problem.

**Context:**
The Service Bus Emulator integration uses tag 2.0.0. In this version the emulator added support for administrative operations.
However for admin operation to work one needs to point the `ServiceBusAdministrationClient` to a connection string that contains the 5300 port.

**Details:**
From: https://github.com/Azure/azure-service-bus-emulator-installer?tab=readme-ov-file#choosing-the-right-connection-string
> [!Important]
> By default, management operations using the Service Bus Administration Client require appending the port number to the emulator connection string.
>
> For example, when both the emulator and the application are running on the same machine, use the following connection string for administration operations:
"Endpoint=sb://localhost:5300;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;";
>
> For management operations & health-check, the emulator uses port 5300 by default.
> You can configure the emulator to use a different port if required using the EMULATOR_HTTP_PORT environment variable.

From: https://github.com/Azure/azure-service-bus-emulator-installer/issues/17#issuecomment-3765709450
> Additionally, would be good to explicitly call out that there needs to be 2 connection strings for
> 1. ServiceBusAdministrationClient that includes the port number and
> 2. ServiceBusClient
> While it's becoming clear from looking at the samples, it would be good to highlight it as some libraries take a single connection string and that won't work with the emulator.

### Describe the solution you'd like

**Ask:**
Aspire should make it easy for downstream consumers of emulators to create admin clients by injecting an environment variable with the above (admin specific) connection string.
Maybe this can be an opt-in behavior similar to CosmosDB's `WithDataExplorer()` or PostgreQL's `WithPgAdmin()`

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

No file or test is named in the issue. Start by locating Aspire's Service Bus Emulator integration and reviewing its existing connection-string environment variables and tests; compare them with the Azure emulator's administration connection-string requirements. Done means an explicitly supported way for downstream consumers to obtain the port-specific administration connection string, with coverage for the chosen opt-in behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cloud
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.