# Compiler Warning ASPIREACANAMING001

<Badge
  text="Version introduced: 13.2"
  variant="note"
  size="large"
  class:list={'mb-1'}
/>

> WithCompactResourceNaming is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.

This diagnostic warning is reported when using the experimental `WithCompactResourceNaming` extension method on an Azure Container App environment. This API opts the environment into shorter, compact names for the volume-backing Azure Storage resources that Aspire provisions, which avoids storage-account name-length collisions when the environment name is long. It doesn't rename the Container App environment, container registry, Log Analytics workspace, or managed identity.

## Example

The following code generates `ASPIREACANAMING001`:

```csharp title="AppHost.cs"
var builder = DistributedApplication.CreateBuilder(args);

builder.AddAzureContainerAppEnvironment("env")
    .WithCompactResourceNaming();

builder.Build().Run();
```

## To correct this warning

Suppress the warning with one of the following methods:

- Set the severity of the rule in the _.editorconfig_ file.

  ```ini title=".editorconfig"
  [*.{cs,vb}]
  dotnet_diagnostic.ASPIREACANAMING001.severity = none
  ```

  For more information about editor config files, see [Configuration files for code analysis rules](/diagnostics/overview/#suppress-in-the-editorconfig-file).

- Add the following `PropertyGroup` to your project file:

  ```xml title="C# project file"
  <PropertyGroup>
      <NoWarn>$(NoWarn);ASPIREACANAMING001</NoWarn>
  </PropertyGroup>
  ```

- Suppress in code with the `#pragma warning disable ASPIREACANAMING001` directive:

  ```csharp title="Suppressing the warning"
  #pragma warning disable ASPIREACANAMING001
  builder.AddAzureContainerAppEnvironment("env")
      .WithCompactResourceNaming();
  #pragma warning restore ASPIREACANAMING001
  ```

## See also

- [ASPIREACANAMING002](/diagnostics/aspireacanaming002/) - Related experimental resource-naming API
- [Configure Azure Container Apps environments](/integrations/cloud/azure/configure-container-apps/) - Learn about customizing Azure Container Apps