Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/frontend/config/sidebar/reference.topics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ export const referenceTopics: StarlightSidebarTopicsUserConfig = {
},
{ label: 'ASPIREAZURE001', link: '/diagnostics/aspireazure001' },
{ label: 'ASPIREAZURE002', link: '/diagnostics/aspireazure002' },
{ label: 'ASPIREAZURE003', link: '/diagnostics/aspireazure003' },
],
},
],
Expand Down
49 changes: 49 additions & 0 deletions src/frontend/src/content/docs/diagnostics/aspireazure003.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: Compiler Error ASPIREAZURE003
description: Learn more about compiler Error ASPIREAZURE003. Azure Virtual Network types and members are for evaluation purposes only and are subject to change or removal in future updates.
---

import { Badge } from '@astrojs/starlight/components';

<Badge
text="Version introduced: 13.2"
variant="note"
size="large"
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.

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.

## Example

The following code generates `ASPIREAZURE003`:

```csharp title="C# — AppHost.cs"
var vnet = builder.AddAzureVirtualNetwork("vnet");
var subnet = vnet.AddSubnet("pe-subnet", "10.0.1.0/24");
```

## To correct this error

Suppress the error with either of the following methods:

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

```ini title=".editorconfig"
[*.{cs,vb}]
dotnet_diagnostic.ASPIREAZURE003.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);ASPIREAZURE003</NoWarn>
</PropertyGroup>
```

- Suppress in code with the `#pragma warning disable ASPIREAZURE003` directive.
1 change: 1 addition & 0 deletions src/frontend/src/content/docs/diagnostics/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ The following table lists the possible MSBuild and analyzer warnings and errors
| [ASPIREATS001](/diagnostics/aspireats001/) | (Experimental) Warning | ATS (Aspire Type Specification) types are for evaluation purposes only and are subject to change or removal in future updates. |
| [ASPIREAZURE001](/diagnostics/aspireazure001/) | (Experimental) Error | Publishers are for evaluation purposes only and are subject to change or removal in future updates. |
| [ASPIREAZURE002](/diagnostics/aspireazure002/) | (Experimental) Error | Azure Container App Jobs are for evaluation purposes only and are subject to change or removal in future updates. |
| [ASPIREAZURE003](/diagnostics/aspireazure003/) | (Experimental) Error | Azure Virtual Network types and members are for evaluation purposes only and are subject to change or removal in future updates. |
| [ASPIRECERTIFICATES001](/diagnostics/aspirecertificates001/) | (Experimental) Warning | Certificate configuration types and members are for evaluation purposes only and are subject to change or removal in future updates. |
| [ASPIRECOMPUTE001](/diagnostics/aspirecompute001/) | (Experimental) Error | Compute related types and members are for evaluation purposes only and is subject to change or removal in future updates. |
| [ASPIRECOMPUTE002](/diagnostics/aspirecompute002/) | (Experimental) Warning | The GetHostAddressExpression method is for evaluation purposes only and is subject to change or removal in future updates. |
Expand Down