From d0b044be58134f9b49795751a20e6d460a88c41e Mon Sep 17 00:00:00 2001 From: "aspire-repo-bot[bot]" <268009190+aspire-repo-bot[bot]@users.noreply.github.com> Date: Sat, 30 May 2026 22:02:23 +0000 Subject: [PATCH 1/2] docs: update ASPIREAZURE003 to cover AzureRoleAssignmentResource (13.4) AzureRoleAssignmentResource is now marked [Experimental("ASPIREAZURE003")] as part of the 13.4 API review fixes (microsoft/aspire#17706). Update the diagnostic page to list all APIs that trigger ASPIREAZURE003 and add an experimental caution to the role-assignments programmatic inspection section. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../docs/diagnostics/aspireazure003.mdx | 24 +++++++++++++++---- .../cloud/azure/role-assignments.mdx | 10 ++++++++ 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/src/frontend/src/content/docs/diagnostics/aspireazure003.mdx b/src/frontend/src/content/docs/diagnostics/aspireazure003.mdx index a8ad2c806..44191d27f 100644 --- a/src/frontend/src/content/docs/diagnostics/aspireazure003.mdx +++ b/src/frontend/src/content/docs/diagnostics/aspireazure003.mdx @@ -1,6 +1,6 @@ --- title: Compiler Error ASPIREAZURE003 -seoTitle: "ASPIREAZURE003: Azure Virtual Network types and members are" +seoTitle: "ASPIREAZURE003: Azure types are experimental and subject to change" description: Learn what causes the Aspire compiler error ASPIREAZURE003 and how to fix it so your AppHost builds cleanly. Resolve or suppress it to keep your Aspire build. --- @@ -13,11 +13,18 @@ import { Badge } from '@astrojs/starlight/components'; class:list={'mb-1'} /> -> Azure Virtual Network types and members are for evaluation purposes only and are subject to change or removal in future updates. Suppress this diagnostic to proceed. +> Azure types and members are for evaluation purposes only and are subject to change or removal in future updates. Suppress this diagnostic to proceed. -The Aspire Azure hosting integration now ships with support for Azure Virtual Networks. If you're using any of the `Aspire.Hosting.Azure.Network` APIs such as `AddAzureVirtualNetwork`, you might see a compiler error/warning indicating that the API is experimental. This behavior is expected, as the API is still in preview and the shape of this API is expected to change in the future. +The `ASPIREAZURE003` diagnostic applies to experimental Azure types in Aspire hosting integrations. If you use any of the following APIs, you may see a compiler error or warning indicating that the API is experimental. This behavior is expected, as these APIs are still in preview and subject to change. -## Example +**APIs that trigger `ASPIREAZURE003`:** + +- `Aspire.Hosting.Azure.Network` APIs such as `AddAzureVirtualNetwork` (since 13.2) +- `AzureRoleAssignmentResource` from `Aspire.Hosting.Azure` (since 13.4) + +## Examples + +### Azure Virtual Network (since 13.2) The following code generates `ASPIREAZURE003`: @@ -26,6 +33,15 @@ var vnet = builder.AddAzureVirtualNetwork("vnet"); var subnet = vnet.AddSubnet("pe-subnet", "10.0.1.0/24"); ``` +### Azure role assignment resource (since 13.4) + +Using `AzureRoleAssignmentResource` directly also generates `ASPIREAZURE003`: + +```csharp title="C# — AppHost.cs" +// Directly referencing AzureRoleAssignmentResource triggers ASPIREAZURE003 +var roleAssignment = new AzureRoleAssignmentResource("role", ...); +``` + ## To correct this error Suppress the error with either of the following methods: diff --git a/src/frontend/src/content/docs/integrations/cloud/azure/role-assignments.mdx b/src/frontend/src/content/docs/integrations/cloud/azure/role-assignments.mdx index e33317806..ff6aeef28 100644 --- a/src/frontend/src/content/docs/integrations/cloud/azure/role-assignments.mdx +++ b/src/frontend/src/content/docs/integrations/cloud/azure/role-assignments.mdx @@ -101,6 +101,15 @@ For more information, see [Azure built-in roles](https://learn.microsoft.com/azu ## Inspect role assignments programmatically +:::caution[Experimental API] +`AzureRoleAssignmentResource` is marked as experimental ([`ASPIREAZURE003`](/diagnostics/aspireazure003/)) as of Aspire 13.4. Its API shape may change in future releases. Suppress the diagnostic to use it: + +```ini title=".editorconfig" +[*.{cs,vb}] +dotnet_diagnostic.ASPIREAZURE003.severity = none +``` +::: + Aspire represents each set of role assignments as an `AzureRoleAssignmentResource` in the distributed application model. You can enumerate these resources to inspect what role assignments are configured, which Azure resource they target, and which Aspire resource owns them. This is useful in [pipeline steps](/deployment/pipelines/) that need to reason about security configuration before deployment. `AzureRoleAssignmentResource` exposes three properties: @@ -115,6 +124,7 @@ The following example shows how to add a pipeline step that runs during `WellKno ```csharp title="AppHost.cs" #pragma warning disable ASPIREAZURE001 // AzureEnvironmentResource is Experimental +#pragma warning disable ASPIREAZURE003 // AzureRoleAssignmentResource is Experimental var builder = DistributedApplication.CreateBuilder(args); From e5fc92ede25ba4347b786439697a0f8c182dff76 Mon Sep 17 00:00:00 2001 From: David Pine <7679720+IEvangelist@users.noreply.github.com> Date: Sat, 30 May 2026 19:56:15 -0500 Subject: [PATCH 2/2] Address review feedback (1 thread) - Broaden ASPIREAZURE003 affected API list (PRRT_kwDOQK_VN86F5tQC) Verified against microsoft/aspire@2574ef57e97fc393aff67592fd442afca6a6d02f on branch release/13.4. Edited per the doc-writer skill. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../src/content/docs/diagnostics/aspireazure003.mdx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/frontend/src/content/docs/diagnostics/aspireazure003.mdx b/src/frontend/src/content/docs/diagnostics/aspireazure003.mdx index 44191d27f..c83d2082a 100644 --- a/src/frontend/src/content/docs/diagnostics/aspireazure003.mdx +++ b/src/frontend/src/content/docs/diagnostics/aspireazure003.mdx @@ -15,12 +15,13 @@ import { Badge } from '@astrojs/starlight/components'; > Azure types and members are for evaluation purposes only and are subject to change or removal in future updates. Suppress this diagnostic to proceed. -The `ASPIREAZURE003` diagnostic applies to experimental Azure types in Aspire hosting integrations. If you use any of the following APIs, you may see a compiler error or warning indicating that the API is experimental. This behavior is expected, as these APIs are still in preview and subject to change. +The `ASPIREAZURE003` diagnostic applies to experimental Azure types in Aspire hosting integrations. If you use one of these APIs, you may see a compiler error or warning indicating that the API is experimental. This behavior is expected, as these APIs are still in preview and subject to change. -**APIs that trigger `ASPIREAZURE003`:** +**APIs that trigger `ASPIREAZURE003` include, but aren't limited to:** - `Aspire.Hosting.Azure.Network` APIs such as `AddAzureVirtualNetwork` (since 13.2) -- `AzureRoleAssignmentResource` from `Aspire.Hosting.Azure` (since 13.4) +- `Aspire.Hosting.Azure` types such as `AzureRoleAssignmentResource`, `DelegatedSubnetAnnotation`, `IAzureDelegatedSubnetResource`, `IAzurePrivateEndpointTarget`, `IAzureNspAssociationTarget`, and `PrivateEndpointTargetAnnotation` (since 13.4) +- `Aspire.Hosting.Azure.Sql` APIs such as `WithAdminDeploymentScriptSubnet`, `WithAdminDeploymentScriptStorage`, `AdminDeploymentScriptSubnetAnnotation`, and `SubnetAddressAllocator` (since 13.4) ## Examples