title: how to get custom environment variables in IConfiguration in .NET Core
body: <pre><code>public static IWebHostBuilder CreateWebHostBuilder(string[] args) =&gt;
      WebHost.CreateDefaultBuilder(args)
      .ConfigureAppConfiguration(a =&gt; { 
          a.AddEnvironmentVariables();
      })
      .UseStartup&lt;Startup&gt;();
  </code></pre>
  
  <p>and inside the API I'm calling   like this, and It is not supporting for custom variables, How do I get custom variable 
  I already created a custom variable in the system.  </p>
  
  <pre><code>public ActionResult&lt;IEnumerable&lt;string&gt;&gt; Get() {
      var t = configuration.GetSection("yash2").Value;
      return new string[] { "value1", "value2" };
  }
  </code></pre>