Enhance Azure ServiceBus client integration to support deep linking and specific client injection
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
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.
The Azure ServiceBus integration in Aspire currently offers distinct capabilities between hosting and client integrations.
- **Hosting Integration:** Supports declaring topics, queues, and subscriptions via APIs such as `IAzureServiceBusBuilder.AddQueue`, `AddTopic`, and `AddSubscription` (see e.g. `Aspire.Hosting.AzureServiceBus` APIs).
- **Client Integration:** Currently only allows injecting a `ServiceBusClient` instance using the configured connection string. There is no support for directly injecting clients for a specific topic, queue, or subscription, nor for supporting deep linking via more granular connection string references.
Other Azure resource integrations (such as Storage and Event Hubs) now support deep linking, allowing references to specific resources (e.g., a particular queue, topic, or subscription), and enabling injection of resource-specific clients (potentially with keyed injection when multiple are registered).
### Describe the solution you'd like
Bring the Azure ServiceBus client integration up to parity with other Azure resource types by supporting:
- Deep linking: Allowing references to a specific Service Bus topic, queue, or subscription via connection string or configuration.
- Injection of specific client types for topics, queues, or subscriptions (e.g., `ServiceBusSender`, `ServiceBusReceiver`), rather than only the generic `ServiceBusClient`.
- Support for keyed registration/injection when multiple resources of the same type are configured.
- Ensure APIs are consistent with other Azure resource integrations.
### Additional context
This will bring Azure ServiceBus integration up to parity with other Azure resources and enable more flexible and discoverable client usage in Aspire.
Contributor guide
Assessment
This issue has not been assessed yet.