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

Поділитися
Вставка
  • Опубліковано 27 жов 2024

КОМЕНТАРІ • 8

  • @bo44arov
    @bo44arov Рік тому +2

    thanks for this tutorial! really useful!

  • @markcoleman8579
    @markcoleman8579 Рік тому +4

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

    • @serverlessjames
      @serverlessjames  Рік тому

      Yes, absolutely. That's great feedback thanks Mark 👍

  • @hki6mq
    @hki6mq Рік тому

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

    • @serverlessjames
      @serverlessjames  Рік тому +1

      There's a great blog post on the AWS blogs that talk through how to deploy .NET with the CDK ☺️
      aws.amazon.com/blogs/modernizing-with-aws/build-package-publish-dotnet-csharp-lambda-functions-aws-cdk/

  • @stavvers
    @stavvers Рік тому

    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 Amazon.Lambda.AspNetCoreServer.APIGatewayHttpApiV2ProxyFunction.MarshallRequest(InvokeFeatures features, APIGatewayHttpApiV2ProxyRequest apiGatewayRequest, ILambdaContext lambdaContext)",
    "at Amazon.Lambda.AspNetCoreServer.AbstractAspNetCoreFunction`2.FunctionHandlerAsync(TREQUEST request, ILambdaContext lambdaContext)",
    "at Amazon.Lambda.RuntimeSupport.HandlerWrapper.c__DisplayClass26_0`2.d.MoveNext()",
    "--- End of stack trace from previous location ---",
    "at Amazon.Lambda.RuntimeSupport.LambdaBootstrap.InvokeOnceAsync(CancellationToken cancellationToken)"
    ]
    }
    Is this due to the proxy not being set up?

    • @serverlessjames
      @serverlessjames  Рік тому +1

      Great question Andy! What exactly are you passing as the input payload when you're invoking the function from Visual Studio? Under the hood, the AWS tooling is translating what it's expecting to be an API Gateway input payload into a request it can pass to ASP.NET (that's what the marshall request method does).
      If you invoke the function with say, a string of 'Hello World' that deseriailzed object will be null, causing an object reference error.
      If you @ me on twitter I can send a quick video