Allow specifying a default EntityPath for Azure Event Hubs / Azure Service Bus connection string #7093
Labels
area-integrations
Issues pertaining to Aspire Integrations packages
azure
Issues associated specifically with scenarios tied to using Azure
azure-eventhubs
Issues related to Azure Event Hubs integration
Milestone
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
Can we add support for setting an EntityPath in the connection string now that the application model is stable. Having to set the EventHubName via the settings callback for integrations is bothersome.
Describe the solution you'd like
An API extension like the following seems the least intrusive:
builder.AddAzureEventHubs("ns").WithHub("hub", configure => configure.IsDefaultEntity = true);
...would result in the following connectionstring being available to integrations:
Endpoint=sb://<NamespaceName>.servicebus.windows.net/;SharedAccessKeyName=<KeyName>;SharedAccessKey=<KeyValue>;EntityPath=hub
Not setting a default entity should result in a connection string for the namespace only. The builder should throw [on build?] if more than one hub is set as default. I presume this should also work the same for ASB queues etc.
Additional context
No response
The text was updated successfully, but these errors were encountered: