title: Azure Web App error 500 on Connection String
body: <p>I've a simple ASP.NET Core 1.0 application which seeds some data in to SQL Server in Azure. I've 2 databases, one is for development and other is for Production (Azure SQL), I'm using Identity. When I run my application on my local machine, it works fine, but when I deploy it I get the error 500 (Internal Server Error) with no further explanation here is my code.</p>
  
  <pre><code>if (CurrentEnvironment.IsDevelopment())
          {
              services.AddDbContext&lt;ApplicationDbContext&gt;(options =&gt; 
                                                          options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
          }
          else if (CurrentEnvironment.IsStaging() || CurrentEnvironment.IsProduction())
          {
              services.AddDbContext&lt;ApplicationDbContext&gt;(options =&gt;
                                                          options.UseSqlServer(Environment.GetEnvironmentVariable("SQLCONNSTR_kConnectionString")));
          }
  </code></pre>
  
  <p>If I change the environment setting from Production to Development using Azure Application Settings, it says that error is at <code>Configuration.GetConnectionString("DefaultConnection")</code> saying connection string cannot be null.</p>