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
- A ASP.NET Core project (dotnet publish -c Release -o out in the builder, then dotnet .dll on the dotnet-10 template with ASPNETCORE_URLS bound to PORT)
- An Ample account token with servers:write
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
- Template: dotnet-10
- Runtime: dotnet
- Size: s-1vcpu-1gb
- Build:
dotnet publish -c Release -o out - Start:
ASPNETCORE_URLS=http://0.0.0.0:$PORT dotnet out/$(basename $(ls out/*.runtimeconfig.json | head -n 1) .runtimeconfig.json).dll
Limitations
- Verified on the dotnet-10 template at s-1vcpu-1gb; other sizes and ASP.NET Core major versions are not verified.
- Region, compliance attestations and request-duration limits are unknown and not claimed.
Cost Estimate
- Currency: USD
- Monthly Amount: 5.0
- Basis: Size prices from pricing.toml (loaded by the API) at build revision 1ac5595375130d45290090e82ed0f554ccd45405-dirty
- Components:
- Name: app server
- Size: s-1vcpu-1gb
- Quantity: 1.0
- Monthly Amount: 5.0
- Note: Always-on monthly price of the tested sizes; apps auto-pause when idle. Buckets are allocation-priced per quota and not included.
Evidence Summary
- Kind: canary_run
- Summary: ASP.NET Core pattern fixture deployed on Ample.
- Observed At: 2026-09-21T01:15:54Z
- Implementation Revision: 50dbac567d2c5cc8e55e6c748a646be0025d9cfb-dirty (CLI 0.1.21)
- Expires At: 2027-03-20T01:15:54Z
- Scope: Checks -
/p/configuration-secrets - Template: dotnet-10
Next Actions
- Browse the catalog index:
GET /v1/catalog - Search published recipes by intent, stack and constraints:
POST /v1/catalog/search - Prepare a side-effect-free deployment plan for an authorized project:
POST /v1/catalog/plan - Read the existing agent authentication setup:
GET /mcp/setup - Browse ASP.NET Core:
GET /v1/catalog/nodes/stack%3Aframework-asp-net-core - Browse Configure deployment:
GET /v1/catalog/nodes/intent%3Aconfigure-deployment - Browse Public web service:
GET /v1/catalog/nodes/pattern%3Apublic-web-service