Allow ServiceBus connection strings to work with EntityPath key#7523
Merged
davidfowl merged 1 commit intomicrosoft:mainfrom Feb 11, 2025
Merged
Allow ServiceBus connection strings to work with EntityPath key#7523davidfowl merged 1 commit intomicrosoft:mainfrom
davidfowl merged 1 commit intomicrosoft:mainfrom
Conversation
In the future, the ServiceBus Host integration will append this value to the connection string. This will allow the queue, topic, and subscription names to be specified outside of the application. (Today they are hard-coded in both, or specified separately in config.) We can also add new client APIs to register a Sender or Processor in DI.
Note that the Subscription can be passed in the EntityPath using the format {topic}/Subscriptions/{subscription}.
This is a stop-gap to support these values in .NET Aspire 9.1 client integration so it doesn't break applications when we start adding these values in the future.
Contributes to microsoft#7407
sebastienros
approved these changes
Feb 11, 2025
| // The EntityPath can contain a queue or topic name. And if it references a topic, | ||
| // it can contain {topic}/Subscriptions/{subscription}. See https://github.com/Azure/azure-sdk-for-net/pull/27070 | ||
|
|
||
| if (connectionBuilder.TryGetValue("EntityPath", out var _)) |
Contributor
There was a problem hiding this comment.
Can be removed, equivalent to connectionBuilder.Remove("EntityPath"); which returns bool
Member
Author
There was a problem hiding this comment.
In the future we will use the EntityPath value to initialize the queue/topic name, and optionally the subscription name.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In the future, the ServiceBus Host integration will append this value to the connection string. This will allow the queue, topic, and subscription names to be specified outside of the application. (Today they are hard-coded in both, or specified separately in config.) We can also add new client APIs to register a Sender or Processor in DI.
Note that the Subscription can be passed in the EntityPath using the format {topic}/Subscriptions/{subscription}.
This is a stop-gap to support these values in .NET Aspire 9.1 client integration so it doesn't break applications when we start adding these values in the future.
Contributes to #7407
Checklist