When I created my first AWS Serverless application from a template (a blueprint) in Visual Studio, I expected that I could just run it locally the same way as I always run Azure Functions. However, I received the following error:
Unable to run your project. The “RunCommand” property is not defined.
I cannot imagine working on a project without debugging it locally, so of course I started to dig how to start AWS Serverless application without deploying it to the cloud every time I want to test something.
Long story short, I learned that AWS Toolkit extension serves that purpose. Moreover, using any recent version, eliminates the need for manual setup. All you need to do to start a project is select the appropriate debug profile, “Mock Lambda Test Tool”, which surprisingly is not the default option.
This is trivial, but easy to miss if you expect that the default configuration works out-of-the-box. And I think that the next steps are more-or-less intuitive once you launch the test tool, and allow you to experiment until you stumble upon another issue 🙂
If, for whatever reason, such a debugging profile is not available in your Lambda project after creating it from a template, you can in theory add it manually following the instructions in the AWS Lambda Test Tool documentation. But this should not be needed if you have recent tooling.
As a side note: I cannot see any use for the non-working, default profile added by Visual Studio. So, I removed it from launchSettings.json
to avoid confusion about this issue:
Happy coding and low cold start times to you!