Skip to content

Environment Secrets

Ian Ter Haar edited this page Jan 26, 2026 · 1 revision

Secrets Configuration

This service does not store secrets in source control. All sensitive values are supplied at runtime.


Development (User Secrets)

For local development, ASP.NET Core User Secrets are used.

Run these commands in the folder containing the .csproj file.

Initialize:

dotnet user-secrets init

Set required secrets:

dotnet user-secrets set "ConnectionStrings:TAE_Engine" "Server=(localdb)\MSSQLLocalDB;Database=TAE_Engine;Trusted_Connection=True;"
dotnet user-secrets set "UploadStorage:TempDirectory" "C:\tae\uploads\temp"
dotnet user-secrets set "UploadStorage:FinalDirectory" "C:\tae\uploads\final"

View secrets:

dotnet user-secrets list

User secrets are stored outside the repository and are never committed.


Production (Environment Variables)

In production, secrets are supplied via environment variables.

Mapping:

  • ConnectionStrings__UploadDbConnectionStrings:UploadDb
  • UploadStorage__TempDirectoryUploadStorage:TempDirectory
  • UploadStorage__FinalDirectoryUploadStorage:FinalDirectory

Example:

export ConnectionStrings__TAE_Engine="Server=prod-sql;Database=TAE_Engine;User Id=produser;Password=StrongPassword"
export UploadStorage__TempDirectory="/data/uploads/temp"
export UploadStorage__FinalDirectory="/data/uploads/final"

Notes

  • Real appsettings.json files are not committed.
  • The application fails fast if required secrets are missing.
  • Code does not contain environment-specific configuration logic.

Clone this wiki locally