---
title: "Pragmatic connection string management for small Dapper APIs"  
description: "Pragmatic connection string management for small Dapper APIs"  
author: "Ravi Vishwakarma"  
published: 2026-09-30  
updated: 2026-09-30  
canonical: https://www.mindstick.com/forum/162228/pragmatic-connection-string-management-for-small-dapper-apis  
category: "Configuration"  
tags: ["Dapper", "asp.net core", "Configuration", "security"]  
reading_time: 1 minute  

---

# Pragmatic connection string management for small Dapper APIs

Right now our connection strings sit in `appsettings.json` as plain text, and I'm worried about secrets leaking into source control or container images. We're not ready to adopt Azure Key Vault because the team wants to keep dependencies light.

What's the most practical approach for a small ASP.NET Core API using Dapper? I've heard about `User Secrets` for local development and environment variables for staging, but I'm unsure how to wire that cleanly into `IConfiguration` without scattering `GetConnectionString` calls everywhere. Is there a standard helper or pattern you'd recommend?


---

Original Source: https://www.mindstick.com/forum/162228/pragmatic-connection-string-management-for-small-dapper-apis

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
