Getting started with Serverless framework in c#

less than 1 minute read

npm i -g serverless

You can verify the installation by running serverless To see which version of serverless you have installed run:

serverless --version

Lets create a service using the provided CLI.

sls create --template aws-csharp --path lifenote

Serverless: Generating boilerplate...
Serverless: Generating boilerplate in "/Users/./dev/lifenote"
 _______                             __
|   _   .-----.----.--.--.-----.----|  .-----.-----.-----.
|   |___|  -__|   _|  |  |  -__|   _|  |  -__|__ --|__ --|
|____   |_____|__|  \___/|_____|__| |__|_____|_____|_____|
|   |   |             The Serverless Application Framework
|       |                           serverless.com, v2.16.0
 -------'

Serverless: Successfully generated boilerplate for template: "aws-csharp"

To build the solution, run build.sh

# Linux or Mac OS
./build.sh

# Windows PowerShell
.\build.cmd

You can deploy it by sls deploy

This will deploy your function to AWS Lambda based on the settings in serverless.yml.

To invoke the function, do sls invoke -f hello

Comments