Skip to content

Allow defining service groups where cross cutting configuration can be applied #521

Description

If I want to apply environment variables to a set of services, it should be possible to configure them in a group where those get applied. e.g.

Today

var builder = DistributedApplication.CreateBuilder();

builder.AddProject<P1>()
       .WithEnvironment("shared", "shared value")
       .WithEnvironment("unique", "1") ;

builder.AddProject<P2>()
       .WithEnvironment("shared", "shared value")
       .WithEnvironment("unique", "2") ;


builder.AddProject<P3>()
       .WithEnvironment("shared", "shared value")
       .WithEnvironment("unique", "3") ;

builder.Build().Run();

After

var builder = DistributedApplication.CreateBuilder();

var group = builder.CreateGroup();

group.WithEnvironment("shared", "shared value");

group.AddProject<P1>()
     .WithEnvironment("unique", "1") ;

group.AddProject<P2>()
     .WithEnvironment("unique", "2") ;

group.AddProject<P3>()
     .WithEnvironment("unique", "3") ;

builder.Build().Run();

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-app-modelIssues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplicationneeds-design📎papercut

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions