Compiler Warning ASPIREACANAMING001
Это содержимое пока не доступно на вашем языке.
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
Section titled “Example”The following code generates ASPIREACANAMING001:
var builder = DistributedApplication.CreateBuilder(args);
builder.AddAzureContainerAppEnvironment("env") .WithCompactResourceNaming();
builder.Build().Run();To correct this warning
Section titled “To correct this warning”Suppress the warning with one of the following methods:
-
Set the severity of the rule in the .editorconfig file.
.editorconfig [*.{cs,vb}]dotnet_diagnostic.ASPIREACANAMING001.severity = noneFor more information about editor config files, see Configuration files for code analysis rules.
-
Add the following
PropertyGroupto your project file:C# project file <PropertyGroup><NoWarn>$(NoWarn);ASPIREACANAMING001</NoWarn></PropertyGroup> -
Suppress in code with the
#pragma warning disable ASPIREACANAMING001directive:Suppressing the warning #pragma warning disable ASPIREACANAMING001builder.AddAzureContainerAppEnvironment("env").WithCompactResourceNaming();#pragma warning restore ASPIREACANAMING001
See also
Section titled “See also”- ASPIREACANAMING002 - Related experimental resource-naming API
- Configure Azure Container Apps environments - Learn about customizing Azure Container Apps