microsoft / microsoft/aspire

[Proposal] Add APIs to configure DCP options

Open
#7,365 4 comments 1 reaction 0 assignees View on GitHub
area-app-model
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.