Skip to content

Support secrets in app model environment settings. #166

@mitchdenny

Description

@mitchdenny

At the moment in the app model we do the following methods to populate environment variables:

WithEnviroment(string, string)
WithEnvironment(string, Func<string>)
WithEnvironment(Action<Dictionary<string, string>)

I think that we'll probably end up having to add:

WithEnvironment(string, string, EnvironmentHandling) // enum EnvironmenHandling { Secret, NotSecret }
WithEnvironment(string, Func<string>, EnvironmentHandling)
WithEnvironment(Action<EnvironmentContext>)

Usage on that last one:

WithEnvironment((env) => {
  env.AddVariable("FOO", "bar");
  env.AddSecret("BAR", "foo");
});

Most orchestrators have this concept of something that is mapped as an environment variable but is otherwise handled as a secret throughout the platform.

Metadata

Metadata

Assignees

Labels

area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions