Configuration
Environment variables
Section titled “Environment variables”Every setting in appsettings.json can be overridden with an environment variable, using __ where the JSON nests.
| Variable | Default | Description |
|---|---|---|
DOTNET_ENVIRONMENT |
none | Layers appsettings.<environment>.json over appsettings.json. The template ships local and docker |
ASPNETCORE_HTTP_PORTS |
7340 in the container |
The port to listen on |
ASPNETCORE_FORWARDEDHEADERS_ENABLED |
none | Set to true behind a proxy that ends TLS, so HTTPS redirection sees the original scheme |
ConnectionStrings__MovieReviews |
Data Source=movie-reviews.db |
The SQLite connection string. appsettings.docker.json points it at /app/data/movie-reviews.db |
Database__SeedSampleData |
false |
When true, seeds sample data into an empty database. On in local and docker |
Authentication__Authority |
empty | The OAuth authorization server that issues access tokens. Only in solutions created with --include-auth, where an empty value lets every request through |
Authentication__Audience |
empty | The audience access tokens must be issued for, usually the API’s own URL. Only with --include-auth |
Serilog__MinimumLevel__Default |
Information |
The minimum log level. appsettings.local.json lowers it to Debug, and appsettings.json also overrides Microsoft, Microsoft.AspNetCore and System |
Docker build arguments
Section titled “Docker build arguments”| Argument | Default | Description |
|---|---|---|
VERSION_PREFIX |
1.0.0.0 |
The version stamped into the assemblies |
VERSION_SUFFIX |
none | A prerelease label added to the version |
ENVIRONMENT |
docker |
Sets DOTNET_ENVIRONMENT during the build and tests |
BASE_IMAGE_REPO, BASE_IMAGE_BUILD, BASE_IMAGE_BUILD_TAG |
mcr.microsoft.com, dotnet/sdk, 10.0-alpine |
The SDK image used to build and test |
BASE_IMAGE_RUNTIME, BASE_IMAGE_RUNTIME_TAG |
dotnet/aspnet, 10.0-alpine |
The runtime image the API runs on |
Docker Compose services
Section titled “Docker Compose services”| Service | What it is | Port |
|---|---|---|
api |
The image, built from the run stage |
7340, inside the container too |
otel-collector |
The OpenTelemetry Collector, configured by otel-collector.yaml |
7343 (gRPC), 7344 (HTTP) |
aspire-dashboard |
The Aspire dashboard, where the collector sends everything | 7342 |
The ports are the ones on your machine. Each template has its own block of ten, so this one uses 7340 to 7349 and runs beside a solution made from any other template: Minimal API 7310, MCP 7320, GraphQL 7330, Web API 7340 and Lambda Function 7350. The app uses the same port inside its container; the dashboard and collector keep their usual ones.
The api service runs with DOTNET_ENVIRONMENT=docker, mounts the movie-reviews-data volume at /app/data, and sends its logs, traces and metrics over OTLP to otel-collector, which forwards them to aspire-dashboard.
Telemetry
Section titled “Telemetry”The app always collects OpenTelemetry traces and metrics, and exports them, along with its logs, only when OTEL_EXPORTER_OTLP_ENDPOINT is set. These are the standard OpenTelemetry settings, read as environment variables or from any other configuration source.
| Setting | Default | Description |
|---|---|---|
OTEL_EXPORTER_OTLP_ENDPOINT |
none | Where to send traces, metrics and logs. Nothing is exported until it’s set. Docker Compose sets it to the otel-collector service |
OTEL_EXPORTER_OTLP_PROTOCOL |
grpc |
grpc or http/protobuf |
OTEL_EXPORTER_OTLP_HEADERS |
none | Headers for every export, such as an API key for a hosted backend |
OTEL_SERVICE_NAME |
Your solution’s name | The service.name on everything sent |
Every span, metric and log also carries service.version, the version stamped into the build, and deployment.environment.name.
Ports when running with dotnet run
Section titled “Ports when running with dotnet run”src/Presentation/Properties/launchSettings.json sets DOTNET_ENVIRONMENT=local and listens on http://localhost:7340 and https://localhost:7341.