Scale out mechanism is .NET Aspire

239 Views Asked by At

How do I scale out instances of a project in .NET Aspire horizontally?

For instance, in the following example, "products" project is being added, but how to instruct .NET Aspire that multiple instances are needed:

builder.AddProject<Projects.Products>("products");

1

There are 1 best solutions below

0
Denis Micheal On BEST ANSWER

WithReplicas

Configures how many replicas of the project should be created for the project.

Example Usage:

builder.AddProject<Projects.Products>("products").WithReplicas(2);

However, I would advise you to refrain from applying this to a project that applies or works on database migrations.