-
Notifications
You must be signed in to change notification settings - Fork 540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Service Bus emulator support #6737
Conversation
# Conflicts: # Aspire.sln # src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusExtensions.cs
src/Aspire.Hosting.Azure.ServiceBus/ApplicationModel/OptionalValue.cs
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting.Azure.ServiceBus/ApplicationModel/ServiceBusClientAffineProperties.cs
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting.Azure.ServiceBus/ApplicationModel/ServiceBusClientAffineProperties.cs
Outdated
Show resolved
Hide resolved
…alue.cs Co-authored-by: David Pine <[email protected]>
src/Aspire.Hosting.Azure.ServiceBus/ApplicationModel/OptionalValue.cs
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting.Azure.EventHubs/EventHubsEmulatorContainerImageTags.cs
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting.Azure.ServiceBus/Aspire.Hosting.Azure.ServiceBus.csproj
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusEmulatorResource.cs
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting.Azure.ServiceBus/ApplicationModel/ServiceBusClientAffineProperties.cs
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting.Azure.ServiceBus/ApplicationModel/ServiceBusTopic.cs
Outdated
Show resolved
Hide resolved
playground/AzureServiceBus/ServiceBusWorker/ServiceBusWorker.csproj
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusExtensions.cs
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting.Azure.ServiceBus/AzureServiceBusExtensions.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM! Nice work here. This is going to be a very useful feature that our customers will enjoy. Let's get it merged.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
The functions test is failing |
@sebastienros I believe the test failure is related to the key format that we use to inject the connection string for the client integrations: // Injected to support Aspire client integration for Service Bus in Azure Functions projects.
- target[$"Aspire__Azure__Messaging__ServiceBus__{connectionName}"] = ConnectionStringExpression;
+ target[$"Aspire__Azure__Messaging__ServiceBus__{connectionName}__ConnectionString"] = ConnectionStringExpression; |
public bool? RequiresDuplicateDetection { get; set; } | ||
|
||
/// <summary> | ||
/// A value that indicates whether the queue supports the concept of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it weird that this property is named "RequiresSession", but the docs say "whether the queue supports the concept of sessions"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is coming from the CDK ... but independently of it being the correct description or not I wonder if instead of copying the value we could use the <inheritdoc />
.
Thanks @captainsafia for spotting the issue with the AF functional tests. |
What is a status of this ? When we can install package ? |
@huberttrueselftrueme you can follow these instructions to use the nightly builds https://github.com/dotnet/aspire/blob/main/docs/using-latest-daily.md |
@londospark the page could be updated but the important data is the nuget feed url: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet9/nuget/v3/index.json Add this to your sources and you should see the updated versions, example: |
@sebastienros I've pulled the latest nighly version of Aspire, I've created a very basic sample repo with aspire starter template and used the new var serviceBus = builder.AddAzureServiceBus("ServiceBus")
.RunAsEmulator()
.ConfigureInfrastructure(infra =>
{
var resources = infra.GetProvisionableResources();
var serviceBus = resources.OfType<ServiceBusNamespace>().Single();
serviceBus.Name = GetResourceName("asb", infra);
})
.WithTopic("aspire",
topic => { topic.Subscriptions.AddRange([new ServiceBusSubscription("TestSubscription")]); }); When I run the project both on Mac and Windows, I receive the following exception
Is there any extra configuration that should be done to integrate the emulator support? |
For anybody that is developing .NET Aspire on mac and will need to use Service Bus Emulator. Service Bus Emulator is using As the comment suggested, I downgraded to docker version 4.33.0, and the issue was resolved |
Description
Add support for the Service Bus emulator https://techcommunity.microsoft.com/blog/messagingonazureblog/introducing-local-emulator-for-azure-service-bus/4304457
This PR introduces a custom model to configure the emulator and the cloud service. There is another branch that was based on the CDK directly (and use it for the emulator JSON too) but some discussions led to create a custom, simplified one (not really simplified here for the sake of understanding limits), that is then converted to JSON for the emulator, and to CDK resources for provisioning. If the model is not sufficient (can be on purpose to limit it to what users use in most cases) then the emulator configuration can be defined in JSON directly via
WithConfigJson(path)
, customized withRunAsEmulator(c => c.ConfigJson(JsonNode))
, and the CDK resources can be enhanced with the existingConfigureInfrastructure()
.Fixes #6605
Checklist
<remarks />
and<code />
elements on your triple slash comments?breaking-change
template):doc-idea
template):Microsoft Reviewers: Open in CodeFlow