BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News AWS Lambda Supports .NET 6

AWS Lambda Supports .NET 6

This item in japanese

Bookmarks

AWS Lambda recently added support for .NET 6, as both a managed runtime and a container base image. The new runtime introduces new .NET language features and performance optimizations, improves logging and simplifies function definition using top-level statements.

The new .NET 6 Lambda runtime supports both x86 and Arm/Graviton2 processors, adds support for C# 10 and F# 6, and the option to use new coding patterns, using C# 9’s top-level statement in Lambda functions.

One of the major enhancements of the new runtime is the improved logging: in a separate article, Norm Johanson, senior software engineer at AWS, explains:

Logging in .NET Lambda functions has been improved for .NET 6, providing better traceability, and control of what is being logged. (...). One of the common requested features for the previous .NET Lambda runtime was adding the Lambda request ID to logs for better traceability. This is available in the .NET 6 runtime, making the .NET logging format similar to other Lambda runtimes. Levels for log messages are visible in Amazon CloudWatch Logs, like the request id. This makes it easier to filter and search the logs for particular types of messages, such as errors or warnings.

Johanson explains as well the steps to migrate existing Lambda functions running earlier .NET versions and AWS has released a guide that provides details of which other services and tools of the cloud provider already support .NET 6.

Among the benefits of running the latest LTS release of .NET, a simplified development process and performance improvements in FileStream, profile-guided optimization, and AOT compilation. The new runtime attracted comments from many developers. In a discussion on Hacker News, user jdmichal writes:

I've been playing with it for running PowerShell lambda, which is maybe even more unusual than running it for just C# or F#. The only thing I don't like is that the runtime really starts choking with less than 256 MB of memory. It can still complete, but it will be much slower. Slow enough that it's actually cheaper in memory-seconds to just give it the extra memory.

In a Reddit thread, user chrisoverzero adds:

The ability to use top-level statements is intriguing, but I find that I have multiple Functions in the same assembly (sometimes even the same class) most of the time, mostly for reduced overhead. I don’t think there’s a way to have multiple entry points, is there?

The new runtime is available in all regions where Lambda is available, except for the AWS China regions.

About the Author

Rate this Article

Adoption
Style

BT