[Proposal] Add APIs to configure DCP options
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
## Background and Motivation
See: https://github.com/dotnet/aspire/pull/7363#discussion_r1938335951
Developers, particularly during testing, occasionally need to modify configuration which is currently only accessible through IConfiguration. Eg, to configure port randomization during testing, dashboard disablement, resource suffixes, etc.
Here are some examples:
- `DcpPublisher:ContainerRuntimeInitializationTimeout`
- `DcpPublisher:RandomizePorts`
- `DcpPublisher:DeleteResourcesOnShutdown`
- `DcpPublisher:ResourceNameSuffix`
- `ASPNETCORE_URLS` (for the AppHost dashboard URL)
- `DOTNET_DASHBOARD_OTLP_ENDPOINT_URL`
## Proposed API
Expose these properties via `DistributedApplicationOptions`, which is passed in to `DistributedApplication.CreateBuilder(DistributedApplicationOptions)` and which is available via the various testing builder creation API overloads on 'DistributedApplicationTestingBuilder`.
## Usage Examples
## Alternative Designs
## Risks
Contributor guide
Assessment
This issue has not been assessed yet.