title: How do I change connection string for Update-Database ef migrations?
body: <p>I am trying to run Update-Database, and I would like to specify the connection string, but the CLI is looking at the wrong one. There are two connection strings in my appsettings.json file:</p>
  
  <pre><code>{
    "Logging": {
      "IncludeScopes": false,
      "LogLevel": {
        "Default": "Warning"
      }
    },
    "ConnectionStrings": {
      "LocalWindows": "data source=.\\SQLEXPRESS;initial catalog=Intranet;persist security info=True;integrated security=true;",
      "AzureDevelopment": "Server=tcp:en..."
    }
  }
  </code></pre>
  
  <p>When I run Update-Database, AzureDevelopment is always the key it uses. So if I copy the LocalWindows connectionstring to AzureDevelopment's value, it updates the correct database. Furthermore, if I delete AzureDevelopment but leave LocalWindows like this:</p>
  
  <pre><code>{
    "Logging": {
      "IncludeScopes": false,
      "LogLevel": {
        "Default": "Warning"
      }
    },
    "ConnectionStrings": {
      "LocalWindows": "data source=.\\SQLEXPRESS;initial catalog=Intranet;persist security info=True;integrated security=true;"
    }
  }
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>Value cannot be null.
  Parameter name: connectionString
  </code></pre>
  
  <p>So it seems at some point, the CLI chose to use the AzureDevelopment string, and I can no longer change the key or supply the connection string as an argument. </p>
  
  <p>My question is how does the migrations CLI know what connection string to use? Is it detecting the string through some reflection magic on the startup settings or what? All I see online is how to specify the project when running Update-Database. There used to be -ConnectionString and -ConnectionStringName parameters for the CLI, but those are no longer available.</p>