title: AWS Lambda C# - Accessing custom context
body: <p>I have a simple Lambda function written in .NET Core (C#) that uses the <code>APIGatewayProxyRequest</code> object to go through all the request properties. </p>
  
  <p>If I test this lambda function (from AWS Lambda), and pass it a sample event config that contains basic information:</p>
  
  <p><a href="https://i.stack.imgur.com/ONop1.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ONop1.png" alt="enter image description here"></a></p>
  
  <p>I can get this information like so:</p>
  
  <pre><code>public string FunctionHandler(APIGatewayProxyRequest request, ILambdaContext context)
          logger.Logger.Log($"Body: {request.Body}  \n");
          logger.Logger.Log($"Path: {request.Path}  \n");
          logger.Logger.Log($"Resource: {request.Resource}  \n");
  </code></pre>
  
  <p>How is it that I can access custom context or authorizer values from the same data:</p>
  
  <p><a href="https://i.stack.imgur.com/f0Muu.png" rel="noreferrer"><img src="https://i.stack.imgur.com/f0Muu.png" alt="enter image description here"></a></p>
  
  <p>I have tried: </p>
  
  <pre><code>logger.Logger.Log($"RequestContext Authorizor: {request.RequestContext.Authorizer}  \n");
  </code></pre>
  
  <p>Including it's different properties (<code>StringKey</code>, <code>PrincipleId</code> etc.)</p>
  
  <p>It seems from Node.js, this would be simply achieved by using this:</p>
  
  <pre><code>event.requestContext.authorizer.customKey
  </code></pre>
  
  <p>There is no such thing in C#?</p>