.NET 7 on AWS Lambda with NativeAOT

  Рет қаралды 3,098

James Eastham

James Eastham

Күн бұрын

Пікірлер: 25
@zacky7862
@zacky7862 Жыл бұрын
Great explanation about NativeAOT. This is very helpful
@serverlessjames
@serverlessjames Жыл бұрын
Glad you found it useful 🙂👍
@disturp
@disturp Жыл бұрын
Can you do this with the .NET Minimal APIs?
@serverlessjames
@serverlessjames Жыл бұрын
You will be able to shortly, yes. I've got an open PR in the Lambda tooling to enable it. I've done some tests with a local build of the libraries though, and it's looking fast 🔥
@balaclavacph1880
@balaclavacph1880 Жыл бұрын
Thanks for good video. Is it possible to have AOT with Lambda Function Url´s?
@serverlessjames
@serverlessjames Жыл бұрын
Yes, absolutely. The format of the input event will match the API Gateway HTTP API request. If you follow the instructions on Bryan's blog to build to function, and then these instructions for native AOT you'll be in the right place. nodogmablog.bryanhogan.net/2022/08/simple-lambda-function-with-a-function-url/
@balaclavacph1880
@balaclavacph1880 Жыл бұрын
@@serverlessjames Thank you! It would be awesome to get EF Core compatible/with trimmed friendly code for AOT. Hoping it will be possible in .Net 8. Any idea if there is a AOT friendly ORM for .Net out there.. That would be awsome!
@serverlessjames
@serverlessjames Жыл бұрын
@@balaclavacph1880 there is an open issue on GitHub tracking the EF Core support. Fingers crossed.
@YTN3rd
@YTN3rd Жыл бұрын
Those benchmark numbers have been updated and they are now roughly on par with NET 6 for NET 7 AOT 😢
@serverlessjames
@serverlessjames Жыл бұрын
Compared to the .NET 6 managed runtime the P50 cold start execution is 70% (778ms to 372ms) faster and the P99 86% (1470ms to 581ms) faster. Once warm the difference is about 10%. Compared to .NET 6 native AOT then yeah the numbers are pretty similar.
@joancomasfdz
@joancomasfdz Жыл бұрын
How do you debug it locally in Visual Studio 2022?
@serverlessjames
@serverlessjames Жыл бұрын
This is a great idea for another video 🎉 I do have a video on my channel on Unit Testing with Lambda. My normal debugging approach is to run my unit tests in debug mode and step through my function code that way.
@michaelakin766
@michaelakin766 Жыл бұрын
@@serverlessjames I just installed the templates, tried to run this through debug and I get "System.UriFormatException: 'Invalid URI: The hostname could not be parsed.'" Any ideas on how to get this to debug locally?
@fatoven4127
@fatoven4127 Жыл бұрын
Awesome video. Have you seen an error like this when deploying? dotnet\sdk\7.0.100\Sdks\Microsoft.DotNet.ILCompiler\build\Microsoft.NETCore.Native.Publish.targets(58,5): error : Cross-OS native compilation is not supported.
@ianknowles
@ianknowles Жыл бұрын
I'm getting the same. Docker isn't firing up and been searching round but no answers as of yet...
@serverlessjames
@serverlessjames Жыл бұрын
Yep, what OS are you compiling on? It might also be worth looking at a later video that covers the SAM tooling which simplifies a lot of this work. kzbin.info/www/bejne/pGOUoWh7r9GraJo
@ianknowles
@ianknowles Жыл бұрын
@@serverlessjames Ah cheers James I actually watch that video aswell and decided to give the SAM cli a try. Funnily enough after installing that the dotnet tools started working. On windows. Do you work directly for AWS. I have a couple of clients one of which at the moment are having a major reshuffle and rebuild of their system. We had a beautifully orchestrated micro-service system that was just getting hit hard between cold start and connecting to DocDB. As POC built a few bits in rust on Grav but there predominantly .NET so I was quite excited when Native AOT templates were announced.
@serverlessjames
@serverlessjames Жыл бұрын
@@ianknowles yeah, it could have been an outdated version of the tooling or something like that ☺️ Yes, I do work for AWS. what kind of cold starts are you seeing?
@ianknowles
@ianknowles Жыл бұрын
@@serverlessjames Possibly outdated but I did run the tools installer as prompted then templates shown up in VS. As for the cold starts 1.3-2.0 seconds on lambda execution .NET 6 (ready-to-run) with the usual AWS Core, Dynamo, EvBr and S3 clients. DocDB first connection taking a similiar amount of time to connect with the mongodb client. But when your 4 levels of invocation deep those delays compound heavily. A lot of the first requests were taking upto 30s and timing out (sub second on subsequent requests). So we opted to role 8 UX related lambdas into one monolyth so they could share connection. May have to move to something like ELK as we need full text search and regex on mongo style filter is underwhelming if your across more than 10k documents but if you have any ideas on how to remedy then all ears. PS I suspect your reasonably local south of manchester?
Building a Serverless REST API in .NET with AWS Lambda
20:13
Nick Chapsas
Рет қаралды 76 М.
At the end of the video, deadpool did this #harleyquinn #deadpool3 #wolverin #shorts
00:15
Anastasyia Prichinina. Actress. Cosplayer.
Рет қаралды 16 МЛН
GTA 5 vs GTA San Andreas Doctors🥼🚑
00:57
Xzit Thamer
Рет қаралды 26 МЛН
The Simplest Way To Build .NET 8 Native AOT Lambda Functions
11:58
James Eastham
Рет қаралды 5 М.
C# (.NET 6) on Lambda with Multiple Handler, API Gateways
1:02:23
Dot Net Learners House
Рет қаралды 3,6 М.
Front-end web development is changing, quickly
3:43
Fireship
Рет қаралды 831 М.
Brutally honest advice for new .NET Web Developers
7:19
Ed Andersen
Рет қаралды 172 М.
The Easiest Way to Create Serverless APIs in .NET
18:14
Nick Chapsas
Рет қаралды 40 М.
The CORRECT way to implement Retries in .NET
17:01
Nick Chapsas
Рет қаралды 87 М.
.NET 8 Is Now Available on AWS Lambda
7:10
James Eastham
Рет қаралды 2 М.
Storing secrets CORRECTLY in .NET using AWS Secrets Manager
23:29
Nick Chapsas
Рет қаралды 42 М.