getOrSetSecret

Method
📦 Aspire.Hosting v17.0.0
interface IUserSecretsManager {
// ... omitted for brevity
getOrSetSecret(
resourceBuilder: IResource,
name: string,
value: string): void;
}

Signature

methodgetOrSetSecret
Gets a secret value if it exists in configuration, or sets it to the provided value if it does not.
getOrSetSecret(
resourceBuilder: IResource,
name: string,
value: string): void
resourceBuilderIResourceA resource builder from the target application.
namestringThe secret name.
valuestringThe value to persist when the secret is missing.

Applies to

This method applies to the following types: