Skip to content
Docs Try Aspire

IUserSecretsManager

Interface
📦 Aspire.Hosting v13.2.0
interface IUserSecretsManager {
readonly filePath: string;
readonly isAvailable: boolean;
getOrSetSecret(
resourceBuilder: IResource,
name: string,
value: string): void;
saveStateJson(
json: string,
cancellationToken?: cancellationToken): void;
trySetSecret(
name: string,
value: string): boolean;
}

Properties

property filePath string get
Gets the FilePath property
property isAvailable boolean get
Gets the IsAvailable property

Methods

Gets a secret value if it exists, or sets it to the provided value if it does not
getOrSetSecret(
resourceBuilder: IResource,
name: string,
value: string): void
resourceBuilder IResource
name string
value string
method saveStateJson
Saves state to user secrets from a JSON string
saveStateJson(
json: string,
cancellationToken?: cancellationToken): void
json string
cancellationToken cancellationToken optional
method trySetSecret
Attempts to set a user secret value
trySetSecret(
name: string,
value: string): boolean
name string
value string
boolean