title: How to access Lambda environment variable?
body: <p>When running a .net core 2.1 AWS Lambda function, it is simple to fetch an environment variable from the AWS Lambda Console in c# using: </p>
  
  <pre><code>var envVariable = Environment.GetEnvironmentVariable("myVariableName");
  </code></pre>
  
  <p>However, when running ASP.NET core 2.1 as a Serverless Application on AWS Lambda, this does not work (the above returns null).</p>
  
  <p>I can set a <em>local</em> env variable in the launchSettings.json file, but I want to use the Env variable from the AWS Lambda console.</p>
  
  <p>How can I access the AWS Lambda Env variable in ASP.NET Core 2.1?</p>