diff --git a/src/frontend/src/content/docs/diagnostics/aspireusersecrets001.mdx b/src/frontend/src/content/docs/diagnostics/aspireusersecrets001.mdx index e9cc39d8e..390311b5f 100644 --- a/src/frontend/src/content/docs/diagnostics/aspireusersecrets001.mdx +++ b/src/frontend/src/content/docs/diagnostics/aspireusersecrets001.mdx @@ -1,6 +1,6 @@ --- title: Compiler Warning ASPIREUSERSECRETS001 -seoTitle: "ASPIREUSERSECRETS001: The user secrets manager APIs are" +seoTitle: 'ASPIREUSERSECRETS001 before Aspire 17.0' description: Learn what causes the Aspire compiler warning ASPIREUSERSECRETS001 — the user secrets manager APIs are experimental and subject to change. --- @@ -13,9 +13,13 @@ import { Badge } from '@astrojs/starlight/components'; class:list={'mb-1'} /> -> User secrets manager types and members are for evaluation purposes only and are subject to change or removal in future updates. Suppress this diagnostic to proceed. +> Before Aspire 17.0, `IUserSecretsManager` and `IDistributedApplicationBuilder.UserSecretsManager` were for evaluation purposes only and subject to change or removal in future updates, and using them required suppressing this diagnostic. -This diagnostic warning is reported when using the experimental `IUserSecretsManager` interface and related user secrets management APIs. These APIs provide centralized management of user secrets for Aspire applications, enabling secure storage and retrieval of sensitive configuration values. +This diagnostic warning was reported when using the experimental `IUserSecretsManager` interface and related user secrets management APIs. These APIs provide centralized management of user secrets for Aspire applications, enabling secure storage and retrieval of sensitive configuration values. + +:::note +`IUserSecretsManager` and `IDistributedApplicationBuilder.UserSecretsManager` have graduated from experimental in Aspire 17.0 and no longer require suppressing this diagnostic. +::: The `IUserSecretsManager` interface provides user secrets management functionality for Aspire: @@ -24,11 +28,9 @@ The `IUserSecretsManager` interface provides user secrets management functionali - **Configuration integration**: Automatically populate configuration from secrets - **State management**: Support for saving deployment state to user secrets -This API is experimental because the user secrets management strategy is being refined based on security requirements and usage patterns, and the interface may evolve to support additional secret management scenarios. - ## Example -The following code generates `ASPIREUSERSECRETS001`: +Before Aspire 17.0, the following code generated `ASPIREUSERSECRETS001`: ```csharp title="AppHost.cs" var builder = DistributedApplication.CreateBuilder(args); @@ -51,7 +53,9 @@ bool success = userSecretsManager.TrySetSecret("MySecret", "SecretValue"); ## To correct this warning -Suppress the warning with either of the following methods: +If you use Aspire 17.0 or later, you don't need to suppress this diagnostic and can remove any existing `ASPIREUSERSECRETS001` suppressions. + +If you use an Aspire version earlier than 17.0, suppress the warning with one of the following methods: - Set the severity of the rule in the _.editorconfig_ file. @@ -70,11 +74,4 @@ Suppress the warning with either of the following methods: ``` -- Suppress in code with the `#pragma warning disable ASPIREUSERSECRETS001` directive: - - ```csharp title="Suppressing the warning" - #pragma warning disable ASPIREUSERSECRETS001 - var userSecretsManager = builder.UserSecretsManager; - bool success = userSecretsManager.TrySetSecret("MySecret", "SecretValue"); - #pragma warning restore ASPIREUSERSECRETS001 - ``` +- Suppress in code with the `#pragma warning disable ASPIREUSERSECRETS001` directive. diff --git a/src/frontend/src/content/docs/whats-new/aspire-17.mdx b/src/frontend/src/content/docs/whats-new/aspire-17.mdx index 4c5cbc2c5..ac7a12e22 100644 --- a/src/frontend/src/content/docs/whats-new/aspire-17.mdx +++ b/src/frontend/src/content/docs/whats-new/aspire-17.mdx @@ -51,6 +51,22 @@ Once Aspire 17.0 is available on the stable channel, use the [`aspire update` co CLI](/get-started/install-cli/). +## 🔐 User secrets manager APIs are stable + +The `IUserSecretsManager` interface and `IDistributedApplicationBuilder.UserSecretsManager` property have graduated from experimental to stable. You can use them in your AppHost without suppressing `ASPIREUSERSECRETS001`: + +```csharp title="AppHost.cs" +var builder = DistributedApplication.CreateBuilder(args); +IUserSecretsManager userSecrets = builder.UserSecretsManager; +``` + +Signatures, defaults, and behavior are unchanged, including persistence semantics, file-path resolution, and `TryDeleteSecret`'s default `false` return value. + + + See [ASPIREUSERSECRETS001](/diagnostics/aspireusersecrets001/) for details on + the diagnostic that no longer applies. + + ## ⚠️ Breaking changes