Compiler Warning ASPIRERADIUS003
Radius cloud provider types and members are for evaluation purposes only and are subject to change or removal in future updates. Suppress this diagnostic to proceed.
This diagnostic warning is reported when using the experimental Radius cloud-provider APIs from the Aspire.Hosting.Radius integration, WithAzureProvider and WithAwsProvider.
The [Experimental] gate is on WithAzureProvider and WithAwsProvider themselves. The credential callbacks you configure through them—such as WithServicePrincipal, WithWorkloadIdentity, WithAccessKey, and WithIrsa—are part of the same experimental surface; they don’t each emit ASPIRERADIUS003 on their own.
These APIs configure the Azure and AWS cloud providers that the Radius publisher emits and that the deploy pipeline registers credentials for.
Example
Section titled “Example”The following code generates ASPIRERADIUS003:
var builder = DistributedApplication.CreateBuilder(args);
var clientSecret = builder.AddParameter("azure-sp-secret", secret: true);
builder.AddRadiusEnvironment("radius") .WithAzureProvider( subscriptionId: "00000000-0000-0000-0000-000000000000", resourceGroup: "rg-radius", azure => azure.WithServicePrincipal( tenantId: "11111111-1111-1111-1111-111111111111", clientId: "22222222-2222-2222-2222-222222222222", clientSecret: clientSecret));
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.ASPIRERADIUS003.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);ASPIRERADIUS003</NoWarn></PropertyGroup> -
Suppress in code with the
#pragma warning disable ASPIRERADIUS003directive:Suppressing the warning var clientSecret = builder.AddParameter("azure-sp-secret", secret: true);#pragma warning disable ASPIRERADIUS003builder.AddRadiusEnvironment("radius").WithAzureProvider(subscriptionId: "00000000-0000-0000-0000-000000000000",resourceGroup: "rg-radius",azure => azure.WithServicePrincipal(tenantId: "11111111-1111-1111-1111-111111111111",clientId: "22222222-2222-2222-2222-222222222222",clientSecret: clientSecret));#pragma warning restore ASPIRERADIUS003
See also
Section titled “See also”- ASPIRERADIUS004 - Radius infrastructure customization APIs
- ASPIRERADIUS006 - Radius secret store APIs
- ASPIRERADIUS057 - Radius container image API