Blog
Mert Özen's blog posts on software development, backend, frontend, and DevOps.
One Artifact, Many Environments: Configuration Layering in .NET, Environment Variables and Runtime Config in Angular
To run one artifact in many environments, put only shared defaults into the artifact and supply environment-specific values at deploy time through environment variables or a runtime config file. On .NET 10 we measure provider order (a BOOKSTORE_ prefix beats the command line, an ASPNETCORE_ prefix loses to appsettings), set up fail fast with ValidateOnStart and [OptionsValidator], and generate Angular's config.json at runtime with provideAppInitializer and an nginx entrypoint.
Configuration and the Options Pattern in ASP.NET Core: Provider Order, User Secrets and Validation
We see the order of ASP.NET Core configuration providers with real output: appsettings, environment variables, command line, user secrets. The Options pattern, IOptions vs IOptionsSnapshot vs IOptionsMonitor, and validation with ValidateOnStart.