User Secrets
User Secrets is a development-time configuration feature that stores sensitive application settings outside project files and source-control repositories.
ASP.NET Core in Action, 3e
The User Secrets manager is an ASP.NET Core development tool and configuration provider for storing sensitive settings outside a project directory.
- How it is used
- Keeps local development secrets outside the project while production deployments commonly use environment variables.
- How deep it goes
- Explains setup commands, provider loading, storage location, and plaintext limitations, but defers detailed secret-store integration.
- Examples
- Uses UserSecretsId setup, dotnet user-secrets commands, Manage User Secrets, and development-only AddUserSecrets<Program>().
- What you can do after
- Operate/configure User Secrets for local ASP.NET Core values without committing them to the project repository.
.NET in Action, Second Edition
User secrets are development-time configuration values stored outside a project to keep sensitive data out of source control.
- How it is used
- Keeps local connection strings and authentication settings out of source control while supplying them through application configuration.
- How deep it goes
- Walks through CLI initialization, setting values, local file locations, and configuration consumption; treats production secret delivery separately.
- Examples
- Uses SQLite and Cosmos DB connection settings, plus developer-specific Azure AD client and tenant IDs.
- What you can do after
- Operate/configure it with `dotnet user-secrets` and read local values through application configuration.
Read how .NET in Action, Second Edition explains User Secrets →
Related concepts
- configurationuses · A specification of settings, parameters, or component relationships that determines how a system, application, model, or process is structured or operates.
- user-jwtsused by · user-jwts is a .NET CLI tool that generates JSON Web Tokens for local testing, including tokens with chosen claims and signatures based on tool-generated key material.
- appsettings.jsonalternative to · appsettings.json is a conventional JSON configuration file used by .NET applications to store application settings.
- secret managementuses · Secret management is the practice of securely handling sensitive values throughout their lifecycle, including their storage, access, distribution, retrieval, and rotation.
- Azure Key Vaultalternative to · Azure Key Vault is a Microsoft Azure managed service for securely storing and controlling access to secrets, cryptographic keys, and certificates.
- project fileconfigured by · A project file is a configuration file that defines a software project’s metadata, source files, dependencies, and build settings.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

