# AzureContainerAppEnvironmentResource.WithCompactResourceNaming

- Module: [Aspire.Hosting.Azure.AppContainers](/reference/api/go/aspire.hosting.azure.appcontainers.md)
- Defined on: [AzureContainerAppEnvironmentResource](/reference/api/go/aspire.hosting.azure.appcontainers/azurecontainerappenvironmentresource.md)
- Version: `17.0.0`
- Kind: `method`

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
type AzureContainerAppEnvironmentResource interface {
    // ... omitted for brevity
    WithCompactResourceNaming() AzureContainerAppEnvironmentResource
}
```

## Signature

```go
WithCompactResourceNaming() AzureContainerAppEnvironmentResource
```

## Returns

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

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

## Defined on

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