title: How to override ASP.NET Core configuration array settings using environment variables
body: <p><strong><a href="https://en.wikipedia.org/wiki/Wikipedia:Too_long;_didn%27t_read" rel="noreferrer">TL;DR</a></strong></p>
  <p>In an ASP.NET Core app, I have an <code>appsettings.json</code> config file which uses a JSON array to configure a collection of settings.</p>
  <p>How do I override a setting of one of the array objects using environment variables?</p>
  <p><strong>Background</strong></p>
  <p>I'm using <a href="https://serilog.net/" rel="noreferrer">Serilog</a> in an ASP.NET Core application and using the <a href="https://github.com/serilog/serilog-settings-configuration#serilogsettingsconfiguration--" rel="noreferrer">Serilog.Settings.Configuration</a>, to allow it to be configured using <code>appsettings.json</code>.</p>
  <p>The configuration is like this:</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;Serilog&quot;: {
      &quot;Using&quot;:  [&quot;Serilog.Sinks.Literate&quot;],
      &quot;MinimumLevel&quot;: &quot;Debug&quot;,
      &quot;WriteTo&quot;: [
        { &quot;Name&quot;: &quot;File&quot;, &quot;Args&quot;: { &quot;path&quot;: &quot;%TEMP%\\Logs\\serilog-configuration-sample.txt&quot; } }
      ],
      &quot;Enrich&quot;: [&quot;FromLogContext&quot;, &quot;WithMachineName&quot;, &quot;WithThreadId&quot;],
      &quot;Properties&quot;: {
          &quot;Application&quot;: &quot;Sample&quot;
      }
    }
  }
  </code></pre>
  <p>When deployed, I want to override some of the settings, e.g. the <em>MinimumLevel</em>, and the path to the log file. My preferred option is to do this via environment variables as I'm deploying to an Azure App Service, so I'll use the App settings through the Azure management portal (these are realised as environment variables).</p>
  <p>I can easily set the <em>MinimumLevel</em> by adding an environment variable with the name: <code>Serilog:MinimumLevel</code> and the application name <code>Serilog:Properties:Application</code>.</p>
  <p>What is the format for specifying a setting with an array?</p>