page:guides:asp net core:configuration secrets

Configure environment and secrets for ASP.NET Core

Summary

Configuration and secrets for a ASP.NET Core app on Ample. Verified on ASP.NET Core: an --env value delivered encrypted and reported as present without being echoed (secret=set). Build and start: dotnet publish -c Release -o out in the builder, then dotnet .dll on the dotnet-10 template with ASPNETCORE_URLS bound to PORT.

Prerequisites

Workflow Steps

Build and start

dotnet publish -c Release -o out in the builder, then dotnet .dll on the dotnet-10 template with ASPNETCORE_URLS bound to PORT; the server must bind 0.0.0.0 on PORT.

Pass values on deploy

Use --env KEY=value (repeatable) or --env-file; values are encrypted at rest and reused on redeploys. Declare names only in ample.toml.

Command: ample deploy . --name --public --env MY_SECRET=...

Verify

Fetch the live URL and /p/configuration-secrets on the example; on failure read the build and runtime logs.

Command: ample logs --kind build

Tested Configuration

Limitations

Cost Estimate

Evidence Summary

Next Actions