Skip to content

[AzureContainerAppEnvironment] Azure resource name contains too many static characters #14427

@FSchmidt-Altus

Description

@FSchmidt-Altus

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

The name given by Aspire to resources contains too many static characters. Which means the uniqueString suffix is not applied causing issues when trying to deploy multiple environments.

Example Azure App Container:

storageVolume = new StorageAccount(Infrastructure.NormalizeBicepIdentifier($"{appEnvResource.Name}_storageVolume"))

storageVolume = new StorageAccount(Infrastructure.NormalizeBicepIdentifier($"{appEnvResource.Name}_storageVolume"))

It always adds storageVolume (13 characters) to the resource name. The maximum length of a storage volume is 24 characters. So if my chosen AddAzureContainerAppEnvironment name is 11 characters or longer then I cannot deploy multiple environments. And even when it is 10 characters long I have a high conflict probability.

Expected Behavior

Static strings applied by Aspire to resource names are as short as possible.
For example AzureContainerAppExtensions changes:

  • storageVolume -> sv
  • shares -> s
  • managedStorage -> ms

Steps To Reproduce

Create AddAzureContainerAppEnvironment with a name of 11 characters (or more) and a volume. Try to deploy two environments. The second deployment will fail with StorageAccountAlreadyTaken.

Exceptions (if any)

No response

.NET Version info

No response

Anything else?

$/aspire --version
13.1.0+8a4db1775c3fbae1c602022b636299cb04971fde

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions