dotnet / aspire

An opinionated, cloud ready stack for building observable, production ready, distributed applications in .NET
https://learn.microsoft.com/dotnet/aspire
MIT License
3.64k stars 409 forks source link

Invalid Cloud deployment of Azure Service Bus topics - name truncation #5341

Open dzejsien opened 3 weeks ago

dzejsien commented 3 weeks ago

Is there an existing issue for this?

Describe the bug

Issue Topics names are truncated in bicep scripts based on fluent distributed application definition. Code

var builder = DistributedApplication.CreateBuilder(args);

var serviceBus = builder.AddAzureServiceBus("serviceBus");

serviceBus.AddTopic("device-connection-state-events", ["device-management"]);
serviceBus.AddTopic("device-lifecycle-events", ["device-management"]);
serviceBus.AddTopic("device-twin-change-events", ["device-management"]);

...

Bicep script from temp

resource serviceBusTopic_*** 'Microsoft.ServiceBus/namespaces/topics@2021-11-01' = {
  parent: serviceBusNamespace_***
  name: 'device-connection-state-'
  location: location
  properties: {
  }
}

and

resource serviceBusTopic_*** 'Microsoft.ServiceBus/namespaces/topics@2021-11-01' = {
  parent: serviceBusNamespace_***
  name: 'device-twin-change-event'
  location: location
  properties: {
  }
}

Expected Behavior

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version info

.net 8

Anything else?

No response

davidfowl commented 3 weeks ago

cc @tg-msft