If your Lambda function is not working as expected here are some tips to help understand what is going on.
In .NET Core Lambda functions all calls to ILambdaContext.Logger.LogLine as well as all Console.Write calls will
be captured by the Lambda service and recorded into CloudWatch Logs. The Log Group assigned to the Lambda function will
follow the pattern /aws/lambda/<function-name>.
If you are using the AWS Toolkit for Visual Studio then from the function view you can view logs from the Logs tab. Push on the green download button to view the logs. There is a few seconds delay from when the .NET code in the Lambda function write the log message to when it will show up in this view. If you don't see the expected messages keep pushing the Refresh button.
The AWS .NET Mock Lambda Test Tool allows you to replay events with a .NET debugger attached. For Visual Studio users this tool will automatically be configured for Lambda projects when they are opened. For other .NET IDEs, like Visual Studio for Code, checkout the README.md for instructions on how to configure the tool for it.
To capture the Lambda JSON event object so that it can be replayed locally, redeploy the Lambda function with the LAMBDA_NET_SERIALIZER_DEBUG environment variable set to true. Once this environment variable is set the JSON event will be written to the CloudWatch Log. Copy the event from the log and past it into the Function Input text box and push Execute Function.
- Getting Started
- What is a serverless application?
- Common AWS Serverless Services
- What are we going to build in this tutorial?
- TODO List AWS Services Used
- Using DynamoDB to store TODO Lists
- Handling service events with Lambda
- Getting ASP.NET Core ready for Serverless
- Deploying ASP.NET Core as a Serverless Application
- Tear Down
- Final Wrap Up
Continue on to next page: Stream processing wrap up
