Run your ASP.NET Minimal API on AWS Lambda in 10 minutes

preview_player
Показать описание
ASP.NET is a powerful technology for building web applications in .NET. .NET 6 introduce a new way of defining your API's, using the minimal API syntax. Minimal API's simplify the definition of your API endpoints and handlers.

AWS provides tooling to run your ASP.NET minimal API on AWS Lambda by adding a single line of code to your existing application. The additional code allows the same code to run on both using the Kestrel web server and with AWS Lambda when deployed into the Lambda environment.

In this video we walk through how to take an out of the box ASP.NET minimal API and deploy that on to AWS Lambda.

00:00 - Introduction
00:30 - Create a new minimal API
01:40 - Install Nuget package
02:10 - Add additional startup code
04:00 - AWS Lambda .NET Global CLI
05:10 - Deploy Function wizard
07:40 - API Gateway Configuration
09:40 - Performance

Links

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

thanks for this tutorial! really useful!

boarov
Автор

Great video James. Any chance you can increase the font size in future videos so that they're easier to view on a tablet?

markcoleman
Автор

Hey James, any advice on how to deploy this using CDK?

hkimq
Автор

Hey James, great video. Question, I have done everything apart from set up a proxy. When I try to access the weatherforecast route I get a 404 and the following error when invoking from visual studio

{
"errorType": "NullReferenceException",
"errorMessage": "Object reference not set to an instance of an object.",
"stackTrace": [
"at features, apiGatewayRequest, ILambdaContext lambdaContext)",
"at request, ILambdaContext lambdaContext)",
"at Amazon.Lambda.RuntimeSupport.HandlerWrapper.<>c__DisplayClass26_0`2.<<GetHandlerWrapper>b__0>d.MoveNext()",
"--- End of stack trace from previous location ---",
"at cancellationToken)"
]
}

Is this due to the proxy not being set up?

stavvers