dotnet-secrets-management

Manage .NET application secrets via user secrets and environment variables.

71|10|Updated Feb 11, 2026
One-click install
npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-secrets-management-wshaddix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dotnet-secrets-management
Source: https://github.com/wshaddix/dotnet-skills/tree/main/skills/dotnet-secrets-management
Command: npx skills add https://github.com/wshaddix/dotnet-skills --skill dotnet-secrets-management-wshaddix

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive approach to handling sensitive information like API keys and connection strings in .NET applications, preventing accidental exposure and ensuring secure practices across development and production environments.

Core Features & Use Cases

  • Secure Local Development: Utilizes dotnet user-secrets for storing secrets outside the repository during development.
  • Production Secrets Management: Leverages environment variables for secure secret injection in production.
  • Options Pattern Integration: Demonstrates binding secrets to strongly-typed options classes with validation.
  • Secret Rotation: Implements patterns for zero-downtime secret rotation.
  • Managed Identity: Recommends managed identity as a best practice to eliminate secrets in cloud environments.
  • Anti-Patterns: Clearly outlines what not to do, such as hardcoding secrets or storing them in appsettings.json.

Quick Start

Use the dotnet-secrets-management skill to set a new user secret named 'MyApi:Key' with the value 'my-super-secret-key-for-dev'.

Frequently Asked Questions about dotnet-secrets-management

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I securely manage .NET application secrets like API keys and connection strings?

To securely manage .NET application secrets, use the user-secrets tool for local development and environment variables for production. Avoid hardcoding credentials in appsettings.json or source control to prevent accidental exposure across environments.

What is the best way to bind environment variables to strongly-typed configuration in .NET?

The best way to bind environment variables to strongly-typed configuration is using the Options pattern with IConfiguration binding. This approach validates secrets and securely injects sensitive configuration data into your .NET application classes.

How do I rotate secrets in a .NET application without downtime?

Rotating secrets in a .NET application without downtime requires implementing specific rotation patterns within your configuration pipeline. Plan safe transitions between credentials and utilize managed identity to eliminate hardcoded secrets in cloud environments.

Can I use appsettings.json to store connection strings and API keys for local development?

You should not use appsettings.json to store connection strings and API keys for local development because it risks committing secrets to source control. Instead, use the dotnet user-secrets tool to store sensitive data outside your repository.

Why should I use managed identity instead of environment variables for production secrets?

You should use managed identity instead of environment variables for production secrets because it eliminates the need to manage credentials entirely. This best practice secures cloud resources without storing or rotating sensitive configuration data manually.