.NET 7 Minimal API with native AOT on AWS Lambda

preview_player
Показать описание
In this video you will learn how you can use minimal API's with .NET 7 on AWS Lambda using native Ahead of Time Compilation with the AWS Serverless Application Model.

AWS Lambda will not support .NET 7 as a managed runtime as it is not an long term support release. However, with NativeAOT compilation going GA this opens up the possibility of running .NET applications on Lambda using a custom runtime.

An important caveat, Microsoft is not officially supporting ASP.NET with native AOT on .NET 7. It is completely functional in this example, but there may be some scenarios in which ASP.NET will not work.

00:00 - Introduction
00:35 - IMPORTANT caveats
01:15 - Starting Project
02:00 - .csproj updates
03:20 - Source Generated Serialization
05:15 - Source Generated Serializers with ASP.NET
06:30 - Managing trimming
08:25 - API Code Updates
14:30 - Validation Endpoint Middleware
17:20 - SAM Template
18:35 - Performance
20:15 - Recap

Рекомендации по теме
Комментарии
Автор

Very helpful video! And yes that startup time was almost unbelievable!

coding_check
Автор

Hey, this is great! Really excited to see C# start contending in the cloud computing space. One question, do you know how much storage this AOT lambda takes?

PaulPetersVids
Автор

HI, in the PUT API
var product = await JsonSerializer.DeserializeAsync<Product>(context.Request.Body,

don't you have the read from request body stream first

anoopdattathreya
Автор

Could you run through the process of getting a trim error or some trim related error and resolving that?

michaelakin
Автор

Awesome tutorial! I was wondering - since this is kinda error-prone (forgetting a serializer or something, other reflective things that won't work anymore) -
Will this kinda setup also run in native AOT when I run it from a unittest? To discover whether everything still works during Unittest-Runtime, instead of during Lambda-Runtime

ronsijm
Автор

Nice video. can you still run the locally with swagger?

michaelakin
Автор

Amazing guide! Thank you so much! I followed your instructions but got an error - Error: Couldn't find valid bootstrap(s): [/var/task/bootstrap /opt/bootstrap] what can be the root cause of issue? I've named assembly as bootstrap according to your video.

oleksandrdidenko
Автор

btw, slightly offtopic, but I haven't upgraded my backend project to dotnet7 yet, because if I can't get this native AOT part to work - AWS isn't supporting dotnet7 as a supported runtime yet. - and I'll have to rollback all my changes...
AFAIK dotnet7 is not getting a LTS release, but stays in STS, which sometimes discourages AWS to start supporting it as a runtime (unless using a custom runtime)

So I was wondering if you might have any insider information you can share about dotnet7 runtime support, whether it's planned to be supported or something

ronsijm
welcome to shbcf.ru