Part 1 – Create an ASP.NET Web Project

Follow the steps below to create and customize an ASP.NET Web Project in Visual Studio.

1. In Visual Studio, use File -> New -> Project to open the New Project dialog. (In Visual Studio 2019, click Create New Project, then search for AWS at the top of the screen)

2. Under the Web project node, select AWS Lambda and the “AWS Serverless Application with Tests (.Net Core)” template, type WebApp-Lambda-Userid as the name for your project, then click the OK button.

3. In the next dialog, select the “API” blueprint, and select “ASP.NET Core Web App”, then click the Finish button to generate the project

4. Open the serveless.template file from your project. This file defines the Lambda and API Gateway configuration. Find the lambda timeout configuration and change it from 30 seconds to 120 seconds, as for the excerpt below:

AspNetCoreFunction" : {
   "Type" : "AWS::Serverless::Function",
   "Properties": {
   "Handler":
   "AWSServerlessLab::AWSServerlessLab.LambdaEntryPoint::FunctionHandlerAsync",
   "Runtime": "dotnetcore2.1",
   "CodeUri": "",
   "MemorySize": 512,
   "Timeout": 120,
   "Role": null,
   "Policies": [ "AWSLambdaFullAccess" ],
   "Environment" : {
   "Variables" : {
   }

  },