title: Storing production secrets in ASP.NET Core
body: <p>I try to figure out where to best store application production secrets for an ASP.NET Core app. There are two similar questions
  <a href="https://stackoverflow.com/questions/31426358/where-should-i-store-the-connection-string-for-the-production-environment-of-my">Where should I store the connection string for the production environment of my ASP.NET Core app?</a>
  and
  <a href="https://stackoverflow.com/questions/39668456/how-to-deploy-asp-net-core-usersecrets-to-production">How to deploy ASP.NET Core UserSecrets to production</a>
  which both recommend using environment variables. </p>
  
  <p>My problem is that I want to run several instances of my web app with different databases and different database credentials. So there should be some per-instance configuration including secrets.</p>
  
  <p>How could this be achieved in a safe way?</p>
  
  <p>Note that the application should be able to self-host and be hostable under IIS! (Later we also plan to run it on Linux if that is of any importance for the question)</p>
  
  <p><strong>Update</strong></p>
  
  <p>This question is not about trying to use ASP.NET user secrets in production! UserSecrets are ruled out for production.</p>