# WithCompactResourceNaming

- Module: [Aspire.Hosting.Azure.AppContainers](/reference/api/go/aspire.hosting.azure.appcontainers.md)
- Version: `17.0.0`
- Kind: `method`
- Defined on: [`AzureContainerAppEnvironmentResource`](/reference/api/go/aspire.hosting.azure.appcontainers/azurecontainerappenvironmentresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Configures the container app environment to use compact resource naming that maximally preserves the `uniqueString` suffix for length-constrained Azure resources such as storage accounts.

## Remarks

By default, the generated Azure resource names use long static suffixes (e.g. `storageVolume`,
`managedStorage`) that can consume most of the 24-character storage account name limit, truncating
the `uniqueString(resourceGroup().id)` portion that provides cross-deployment uniqueness.
When enabled, this method shortens the static portions of generated names so the full 13-character
`uniqueString` is preserved. This prevents naming collisions when deploying multiple environments
to different resource groups.
This option only affects volume-related storage resources. It does not change the naming of the
container app environment, container registry, log analytics workspace, or managed identity.
Use `WithAzdResourceNaming` to change those names as well.

## Definition

```go
func (AzureContainerAppEnvironmentResource) WithCompactResourceNaming() AzureContainerAppEnvironmentResource
```

## Returns

[`AzureContainerAppEnvironmentResource`](/reference/api/go/aspire.hosting.azure.appcontainers/azurecontainerappenvironmentresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`AzureContainerAppEnvironmentResource`](/reference/api/go/aspire.hosting.azure.appcontainers/azurecontainerappenvironmentresource.md)
