title: how do launchSettings.json and appSettings.json work?
body: <p>When creating a new .NET Core project Rider generates me a <code>launchSettings.json</code>, <code>appSettings.json</code> and <code>appSettings.Development.json</code> file. .NET Core seems to be able to handle those configurations on its own, there is nothing I have to code myself. None of these files get ignored by version control.</p>
  
  <p>.NET Core is new to me, I only know Node backends yet. In Node I would install the <code>dotenv</code> package, create a new <code>.env</code> file with the content <code>PORT=3000</code>, add <code>.env</code> files to my .gitignore and access the port via <code>process.env.PORT</code> in my code. Those configuration values only work for me because they are outside from version control.</p>
  
  <p>Comparing the approaches there are some things I didn't understand:</p>
  
  <ul>
  <li><code>.env</code> files should stay outside from version control, but these files don't? What about sensitive information? Or should I just add them to the .gitignore manually?</li>
  <li><p>Taken from <a href="https://www.npmjs.com/package/dotenv#should-i-have-multiple-env-files" rel="noreferrer">here</a> it's clearly recommended to avoid having
  multiple config files.</p>
  
  <blockquote>
    <p>In a twelve-factor app, env vars are granular controls, each fully
    orthogonal to other env vars. They are never grouped together as
    “environments”, but instead are independently managed for each deploy.
    This is a model that scales up smoothly as the app naturally expands
    into more deploys over its lifetime.</p>
  </blockquote>
  
  <p>So wouldn't it be better to delete the <code>appSettings.Development.json</code>
  file and stick with <code>appSettings.json</code>?</p></li>
  <li>The <code>launchSettings.json</code> contains information about the application
  configuration (e.g. <code>"applicationUrl":
  "https://localhost:5001;http://localhost:5000",</code>) and gets picked up
  by version control. What if I want to change the port or other
  settings? And since you know it's a json file I won't be able to add
  placeholders for env variables e.g. <code>http://{{baseUrl}}:{{port}}</code>.
  How to deal with that?</li>
  <li>The <code>launchSettings.json</code> profiles have a <code>environmentVariables</code>
  section with the initial value <code>"ASPNETCORE_ENVIRONMENT":
  "Development"</code> but what is the purpose of <code>appSettings.json</code> then?</li>
  </ul>
  
  <p>I think things are easier than they look but this concept confuses me. Would someone mind explaining it?</p>