Skip to content

Service bus integration customize sku sample documentation incorrect #3158

Closed
@gabynevada

Description

@gabynevada

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When trying to deploy an Azure Service Bus resource while specifying a specific SKU the publisher generate bicep with errors.

Specifically it generates the following bicep which is missing the name parameter in the sku object. It also hardcodes the sku tier, don't know if it's intended behavior vs using the param already established in the default bicep template.

@description('The location for the resource(s) to be deployed.')
param location string = resourceGroup().location

param sku string = 'Standard'

resource bioapps_bus 'Microsoft.ServiceBus/namespaces@2024-01-01' = {
  name: take('servicebus-${uniqueString(resourceGroup().id)}', 50)
  location: location
  properties: {
    disableLocalAuth: true
  }
  sku: {
    tier: 'Premium'
  }
  tags: {
    'aspire-resource-name': 'service-bus'
  }
}

output serviceBusEndpoint string = service_bus.properties.serviceBusEndpoint

output name string = service_bus.name

The default bicep is as follows

@description('The location for the resource(s) to be deployed.')
param location string = resourceGroup().location

param sku string = 'Standard'

resource bioapps_bus 'Microsoft.ServiceBus/namespaces@2024-01-01' = {
  name: take('servicebus-${uniqueString(resourceGroup().id)}', 50)
  location: location
  properties: {
    disableLocalAuth: true
  }
  sku: {
    name: sku
  }
  tags: {
    'aspire-resource-name': 'service-bus'
  }
}

output serviceBusEndpoint string = service_bus.properties.serviceBusEndpoint

output name string = service_bus.name

Expected Behavior

Te generate valid bicep for deploying an Azure Service Bus resource while specifying an SKU.

Steps To Reproduce

Add the following to AppHost

builder
    .AddAzureServiceBus("service-bus")
    .ConfigureInfrastructure(infra =>
    {
      var serviceBusNamespace = infra
        .GetProvisionableResources()
        .OfType<ServiceBusNamespace>()
        .Single();

      serviceBusNamespace.Sku = new ServiceBusSku { Tier = ServiceBusSkuTier.Premium };
    });

Run azd to generate bicep files

azd config set alpha.infraSynth on
azd infra synth

Exceptions (if any)

No response

.NET Version info

.NET SDK:
 Version:           9.0.201
 Commit:            071aaccdc2
 Workload version:  9.0.200-manifests.a3a1a094
 MSBuild version:   17.13.13+1c2026462

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  15.3
 OS Platform: Darwin
 RID:         osx-arm64
 Base Path:   /usr/local/share/dotnet/sdk/9.0.201/

.NET workloads installed:
There are no installed workloads to display.
Configured to use loose manifests when installing new manifests.

Host:
  Version:      9.0.3
  Architecture: arm64
  Commit:       831d23e561

Anything else?

No response


Associated WorkItem - 424820

Metadata

Metadata

Assignees

Labels

📌 seQUESTeredIdentifies that an issue has been imported into Quest.

Type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions