I’ve been trying to set up Aspire in a .NET Core solution that already uses Azure Service Bus for messaging. I followed the steps on this page but got the following error in the component consuming project:
Failed to apply configuration value 'ConnectionStrings__Messaging'. A dependency may have failed to start.
In the App Host project, I got the following error as well:
Connection string parameter resource could not be used because connection string 'Messaging' is missing.
I can see the errors in the Logs section of the dashboard that Aspire provides when I run the App Host project.
In the startup of the component consuming project I have the following line:
builder.AddAzureServiceBusClient("Messaging");
In the appsettings.json, I have this setting:
"ConnectionStrings": { "Messaging": "Endpoint=sb://somenamespace.servicebus.windows.net/;SharedAccessKeyName=Manage;SharedAccessKey=someaccesskey;EntityPath=topic1"},
And lastly, I got the following in the startup of the App Host project:
var serviceBus = builder.AddConnectionString("Messaging");
builder.AddProject<NotificationService>("notificationservice")
.WithReference(serviceBus);
What am I missing? Why are the projects unable to read the configured connection string?