title: Webjob not using appsettings.env.json
body: <p>.NET Core 2.2, WebJobs SDK 3.0</p>
  
  <p>I have a webjob that I configure like this : </p>
  
  <pre><code>        var environmentName = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Development";
  
          HostBuilder builder = new HostBuilder();
          builder.ConfigureAppConfiguration((context, configApp) =&gt; {
              configApp.AddEnvironmentVariables();
              configApp.AddJsonFile("appsettings.json", optional: true);
              configApp.AddJsonFile($"appsettings.{environmentName}.json",optional: false);
          });
          builder.ConfigureHostConfiguration((configApp) =&gt; {
              configApp.AddEnvironmentVariables();
              configApp.AddJsonFile("appsettings.json", optional: true);
              configApp.AddJsonFile($"appsettings.{environmentName}.json", optional: false);
          });
  </code></pre>
  
  <p>I have a <code>appsettings.test.json</code> file deployed to my environment and when I check my environment variable, I have indeed <code>test</code> as the environment.</p>
  
  <p>I can see that the file gets loaded because optional is false and I don't have any exception.</p>
  
  <p>However, when my webjob starts, it doesn't use the storage connection string I have in my appsettings.test.json, it uses the one in appsettings.json</p>
  
  <p>My AppInsights connection doesn't work either and I initializes it like this :</p>
  
  <pre><code>builder.ConfigureLogging((context, b) =&gt; {
              b.AddConfiguration(context.Configuration.GetSection("Logging"));
              Console.WriteLine($"App Insight key is {context.Configuration["ApplicationInsights:InstrumentationKey"]}");
              b.AddApplicationInsightsWebJobs(o =&gt; o.InstrumentationKey = context.Configuration["ApplicationInsights:InstrumentationKey"]);
          });
  </code></pre>
  
  <p>When the code runs, the Console shows the App Insights Key that is in the appsettings.json and not the appsettings.test.json</p>
  
  <p>What can I do to force the host to use my appsettings.test.json?</p>