user secrets
A .NET development tool that stores secrets for a project in your user profile, outside the project folder, so they never reach source control.
User secrets are plain unencrypted files, so they are only for local development credentials.
In more detail
dotnet user-secrets init writes only an identifier into the project file; values live in a secrets.json file on your machine and load only in the Development environment. It is unencrypted and not shared, so production needs a managed secret store.
Example
dotnet user-secrets set Catalog:SigningKey local-keyRelated terms
- secret — Any value that grants access, such as a password, access token or private key, and must be kept out of code and version control.
- managed secret store — A hosted service such as Azure Key Vault or AWS Secrets Manager that stores secrets encrypted, controls who can read them and records access.
- hosting environment — The named environment an app runs in, such as Development, Staging or Production, set by the ASPNETCORE_ENVIRONMENT variable.
Taught in
- The Options Pattern: Strongly Typed Configuration — Modern .NET Core, C# & Enterprise Microservices
- Environment Layering and User Secrets — Modern .NET Core, C# & Enterprise Microservices