SlideShare uma empresa Scribd logo
1 de 31
Baixar para ler offline
© 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Norm Johanson & Steve Roberts
December 1, 2016
DEV207
NEW LAUNCH!
Serverless Development with
C# and AWS Lambda
What to Expect from the Session
• Brief Introduction to AWS Lambda
• Why .NET Core
• New .NET Core Lambda tooling
• Lots of exciting demos!
AWS Lambda Crash Course
• Compute part of the AWS serverless architecture
• Zero administration
• Event-driven scaling
• Never pay for idle time
• Upload your code and go
Why .NET Core?
• Performance
• Modularized design
• Low memory usage
• Open Source
• Built and validated for Amazon Linux
• Allow AWS to respond to security issues
• Cross Platform
• Develop on any platform and run on Amazon Linux
.NET Core Development
• .NET Core 1.0
• https://www.microsoft.com/net/download/core
• Visual Studio 2015 Update 3
• Visual Studio 2015 Tools (Preview 2)
• Target framework netcoreapp1.0
• Package with .NET Core CLI “dotnet publish”
• Upload as a zip file
Declaring Lambda Functions
• Static or instance methods
• Must have a default constructor for instance methods
• Can take 0 or 1 input parameters
public void FunctionHandler()
public void FunctionHandler(S3Event evnt)
public string FunctionHandler(S3Event evnt, ILambdaContext context)
• Optional ILambdaContext parameter
• async methods must return a Task or Task<T>
Declaring Lambda Functions
public async Task FunctionHandler<T>(T obj, ILambdaContext context)
public void FunctionHandler<T>(T obj, ILambdaContext context)
• No generic methods
public async Task FunctionHandler(S3Event evnt, ILambdaContext context) // return void
public async Task<MyType> FunctionHandler(S3Event evnt, ILambdaContext context)
Invoking Lambda Functions
Invoking from AWS Lambda Event Sources
• Function executes in response to events in AWS
services
• A few of the supported services
• Amazon S3
• Amazon DynamoDB
• Amazon Kinesis
• ….
• Scheduled Events
Invoking with the AWS SDKs
• Invoke methods using any SDK
• Great for mobile apps
• Manage credentials with Amazon Cognito
var client = new AmazonLambdaClient(cognitoCredentials, RegionEndpoint.USWest2);
var request = new InvokeRequest
{
FunctionName = "ProcessGameScore",
Payload = gameStats
};
InvokeResponse response = await client.InvokeAsync(request);
Invoking from Amazon API Gateway
• Frontend of the AWS Serverless architecture
• Expose Lambda functions as HTTP API
• Manages authentication, versioning, monitoring and
more
Demo Time
Demo:
Responding to AWS Events
Recap
• Created a new Lambda project in Visual Studio
• Learned how serialization works
• Learned about the handler format
• assemblyname::namespaced-classname::methodname
• Published from Visual Studio
• Configured AWS event source
• Invoked the Lambda function from Visual Studio
Demo:
Cross Platform: Command Line
Yeoman Project Generators
• Project generator ecosystem
• Installable via npm:
• Node.js dependency
• npm install –g yo
• AWS Lambda generators
• npm install –g generator-aws-lambda-dotnet
• yo aws-lambda-dotnet
Recap Cross-Platform Demo
• Created a project with Yeoman
• npm install –g yo generator-aws-lambda-dotnet
• yo aws-lambda-dotnet
• Develop with any editor
• Command line deployment with the .NET CLI and
Amazon.Lambda.Tools NuGet package
• dotnet lambda <command> <args>
• In preview
Demo:
Serverless Application
Demo Application Architecture
internet
GetBlogs()
GetBlog()
AddBlog()
RemoveBlog()
API Gateway
AWS Lambda
Amazon DynamoDB
AWS CloudFormation Stack
Our Serverless Application Deployment
Visual Studio
Project
Amazon S3
AWS CloudFormation
App bundle
(.zip)
Serverless
template
2: Request stack
…other resources
Lambda Functions
…other resources
API Gateway
4: Stack launched
3: Fetch template
Recap Serverless Application
• Created an AWS Serverless application
• Learned about the serverless.template file
• Exposed Lambda functions as a HTTP API
• Deployed using AWS CloudFormation
ASP.NET Core and Web API
• ASP.NET Core is the web framework for .NET Core
• Includes framework for building Web API applications
• Define API controllers to respond to requests
• Maps request data to function parameters
[Route("api/[controller]")]
public class ValuesController : Controller
{
// PUT api/values/5
[HttpPut("{id}")]
public void Put(int id, [FromBody]string value)
{
...
}
...
How can we use ASP.NET Core in Lambda?
• Amazon API Gateway Proxy Integration
• Forwards all requests to a Lambda Function
• Lambda Function
• Converts how requests and responses are represented
between API Gateway and ASP.NET Core
• Implemented by Amazon.Lambda.AspNetCoreServer
NuGet package
• Currently in preview
ASP.NET Core Web API Architecture
IIS /
Nginx
Kestrel
ASP.NET
Core
Hosting
User’s Web API
Controllers
Internet
ASP.NET Core Architecture on Lambda
API
Gateway
Lambda
ASP.NET
Core
Hosting
User’s Web API
Controllers
Internet
Demo:
ASP.NET Core Web API
Recap ASP.NET Core Web API Demo
• Used existing ASP.NET Core framework
• No change to controller code
• Used API Gateway Proxy Integration to forward all
requests
• Lambda function translates between API Gateway and
ASP.NET Core
• Amazon.Lambda.AspNetCoreServer NuGet Package
• In preview
• Looked at the handler source in GitHub
Useful Links
• AWS Toolkit for Visual Studio
• https://aws.amazon.com/visualstudio/
• AWS Lambda .NET GitHub
• https://github.com/aws/aws-lambda-dotnet
• AWS .NET Developer Blog
• https://aws.amazon.com/blogs/developer/category/net/
• AWS Lambda Developer Guide
• http://docs.aws.amazon.com/lambda/latest/dg/welcome.html
• AWS Toolkit for Visual Studio Guide
• http://docs.aws.amazon.com/toolkit-for-visual-
studio/latest/user-guide/welcome.html
Other Related Sessions
CMP211 - Getting Started with Serverless Architectures
SRV202 – What’s New with AWS Lambda
DEV301 - Amazon CloudWatch Logs and AWS Lambda: A Match Made in
Heaven
MBL306 - Serverless Authentication and Authorization: Identity Management
for Serverless Architectures
SVR311 - The State of Serverless Computing
Thank you!
Remember to complete
your evaluations!

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)
AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)
AWS re:Invent 2016: Development Workflow with Docker and Amazon ECS (CON302)
 
AWS re:Invent 2016: NEW LAUNCH! Lambda Everywhere (IOT309)
AWS re:Invent 2016: NEW LAUNCH! Lambda Everywhere (IOT309)AWS re:Invent 2016: NEW LAUNCH! Lambda Everywhere (IOT309)
AWS re:Invent 2016: NEW LAUNCH! Lambda Everywhere (IOT309)
 
AWS re:Invent 2016: Building SaaS Offerings for Desktop Apps with Amazon AppS...
AWS re:Invent 2016: Building SaaS Offerings for Desktop Apps with Amazon AppS...AWS re:Invent 2016: Building SaaS Offerings for Desktop Apps with Amazon AppS...
AWS re:Invent 2016: Building SaaS Offerings for Desktop Apps with Amazon AppS...
 
AWS re:Invent 2016: How Harvard University Improves Scalable Cloud Network Se...
AWS re:Invent 2016: How Harvard University Improves Scalable Cloud Network Se...AWS re:Invent 2016: How Harvard University Improves Scalable Cloud Network Se...
AWS re:Invent 2016: How Harvard University Improves Scalable Cloud Network Se...
 
AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...
AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...
AWS re:Invent 2016: Application Lifecycle Management in a Serverless World (S...
 
BDA402 Deep Dive: Log Analytics with Amazon Elasticsearch Service
BDA402 Deep Dive: Log Analytics with Amazon Elasticsearch ServiceBDA402 Deep Dive: Log Analytics with Amazon Elasticsearch Service
BDA402 Deep Dive: Log Analytics with Amazon Elasticsearch Service
 
使用 Blox 實現容器任務調度與資源編排
使用 Blox 實現容器任務調度與資源編排使用 Blox 實現容器任務調度與資源編排
使用 Blox 實現容器任務調度與資源編排
 
AWS re:Invent 2016: How to Manage Inventory, Patching, and System Images for ...
AWS re:Invent 2016: How to Manage Inventory, Patching, and System Images for ...AWS re:Invent 2016: How to Manage Inventory, Patching, and System Images for ...
AWS re:Invent 2016: How to Manage Inventory, Patching, and System Images for ...
 
Deep Dive on Microservices and Amazon ECS
Deep Dive on Microservices and Amazon ECSDeep Dive on Microservices and Amazon ECS
Deep Dive on Microservices and Amazon ECS
 
Running Containerised Applications at Scale on AWS
Running Containerised Applications at Scale on AWSRunning Containerised Applications at Scale on AWS
Running Containerised Applications at Scale on AWS
 
SRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless CloudSRV203 Getting Started with AWS Lambda and the Serverless Cloud
SRV203 Getting Started with AWS Lambda and the Serverless Cloud
 
AWS re:Invent 2016: Real-time Data Processing Using AWS Lambda (SVR301)
AWS re:Invent 2016: Real-time Data Processing Using AWS Lambda (SVR301)AWS re:Invent 2016: Real-time Data Processing Using AWS Lambda (SVR301)
AWS re:Invent 2016: Real-time Data Processing Using AWS Lambda (SVR301)
 
ENT202 Creating Your Virtual Data Center: VPC Fundamentals and Connectivity O...
ENT202 Creating Your Virtual Data Center: VPC Fundamentals and Connectivity O...ENT202 Creating Your Virtual Data Center: VPC Fundamentals and Connectivity O...
ENT202 Creating Your Virtual Data Center: VPC Fundamentals and Connectivity O...
 
SRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application DevelopmentSRV302 Deep Dive on Serverless Application Development
SRV302 Deep Dive on Serverless Application Development
 
Amazon ECS with Docker | AWS Public Sector Summit 2016
Amazon ECS with Docker | AWS Public Sector Summit 2016Amazon ECS with Docker | AWS Public Sector Summit 2016
Amazon ECS with Docker | AWS Public Sector Summit 2016
 
AWS re:Invent 2016: NEW SERVICE: Centrally Manage Multiple AWS Accounts with ...
AWS re:Invent 2016: NEW SERVICE: Centrally Manage Multiple AWS Accounts with ...AWS re:Invent 2016: NEW SERVICE: Centrally Manage Multiple AWS Accounts with ...
AWS re:Invent 2016: NEW SERVICE: Centrally Manage Multiple AWS Accounts with ...
 
Introduction to Amazon Lightsail
Introduction to Amazon LightsailIntroduction to Amazon Lightsail
Introduction to Amazon Lightsail
 
Hack-Proof Your Cloud: Responding to 2016 Threats
Hack-Proof Your Cloud: Responding to 2016 ThreatsHack-Proof Your Cloud: Responding to 2016 Threats
Hack-Proof Your Cloud: Responding to 2016 Threats
 
Microsoft Best Practices on AWS
Microsoft Best Practices on AWSMicrosoft Best Practices on AWS
Microsoft Best Practices on AWS
 
What's New with AWS Lambda
What's New with AWS LambdaWhat's New with AWS Lambda
What's New with AWS Lambda
 

Destaque

Developing polyglot persistence applications (SpringOne India 2012)
Developing polyglot persistence applications (SpringOne India 2012)Developing polyglot persistence applications (SpringOne India 2012)
Developing polyglot persistence applications (SpringOne India 2012)
Chris Richardson
 

Destaque (20)

NEW LAUNCH! Introducing PostgreSQL compatibility for Amazon Aurora
NEW LAUNCH! Introducing PostgreSQL compatibility for Amazon AuroraNEW LAUNCH! Introducing PostgreSQL compatibility for Amazon Aurora
NEW LAUNCH! Introducing PostgreSQL compatibility for Amazon Aurora
 
AWS Lambda in C#
AWS Lambda in C#AWS Lambda in C#
AWS Lambda in C#
 
AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)
AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)
AWS re:Invent 2016: Saving at Scale with Reserved Instances (ENT307)
 
AWS re:Invent 2016: Cross-Region Replication with Amazon DynamoDB Streams (DA...
AWS re:Invent 2016: Cross-Region Replication with Amazon DynamoDB Streams (DA...AWS re:Invent 2016: Cross-Region Replication with Amazon DynamoDB Streams (DA...
AWS re:Invent 2016: Cross-Region Replication with Amazon DynamoDB Streams (DA...
 
AWS re:Invent 2016: How I learned to embrace DevOps and Configure Infrastruct...
AWS re:Invent 2016: How I learned to embrace DevOps and Configure Infrastruct...AWS re:Invent 2016: How I learned to embrace DevOps and Configure Infrastruct...
AWS re:Invent 2016: How I learned to embrace DevOps and Configure Infrastruct...
 
Serverless Microservices - Real life story of a Web App that uses AngularJS, ...
Serverless Microservices - Real life story of a Web App that uses AngularJS, ...Serverless Microservices - Real life story of a Web App that uses AngularJS, ...
Serverless Microservices - Real life story of a Web App that uses AngularJS, ...
 
Developing polyglot persistence applications (SpringOne India 2012)
Developing polyglot persistence applications (SpringOne India 2012)Developing polyglot persistence applications (SpringOne India 2012)
Developing polyglot persistence applications (SpringOne India 2012)
 
AWS re:Invent 2016: The Cloud Is Enterprise Ready: How the University of Ariz...
AWS re:Invent 2016: The Cloud Is Enterprise Ready: How the University of Ariz...AWS re:Invent 2016: The Cloud Is Enterprise Ready: How the University of Ariz...
AWS re:Invent 2016: The Cloud Is Enterprise Ready: How the University of Ariz...
 
Improving application design with a rich domain model (springone 2007)
Improving application design with a rich domain model (springone 2007)Improving application design with a rich domain model (springone 2007)
Improving application design with a rich domain model (springone 2007)
 
AWS re:Invent 2016: Driving Innovation with Big Data and IoT (GPSST304)
AWS re:Invent 2016: Driving Innovation with Big Data and IoT (GPSST304)AWS re:Invent 2016: Driving Innovation with Big Data and IoT (GPSST304)
AWS re:Invent 2016: Driving Innovation with Big Data and IoT (GPSST304)
 
AWS re:Invent 2016: Partner-Led Migrations to AWS Starting with the Enterpris...
AWS re:Invent 2016: Partner-Led Migrations to AWS Starting with the Enterpris...AWS re:Invent 2016: Partner-Led Migrations to AWS Starting with the Enterpris...
AWS re:Invent 2016: Partner-Led Migrations to AWS Starting with the Enterpris...
 
Microservices and Redis #redisconf Keynote
Microservices and Redis #redisconf KeynoteMicroservices and Redis #redisconf Keynote
Microservices and Redis #redisconf Keynote
 
AWS re:Invent 2016: Managing and Supporting the Windows Platform on AWS (GPSS...
AWS re:Invent 2016: Managing and Supporting the Windows Platform on AWS (GPSS...AWS re:Invent 2016: Managing and Supporting the Windows Platform on AWS (GPSS...
AWS re:Invent 2016: Managing and Supporting the Windows Platform on AWS (GPSS...
 
AWS re:Invent 2016: Serverless to 32 XLarge: A Unified Security Approach To A...
AWS re:Invent 2016: Serverless to 32 XLarge: A Unified Security Approach To A...AWS re:Invent 2016: Serverless to 32 XLarge: A Unified Security Approach To A...
AWS re:Invent 2016: Serverless to 32 XLarge: A Unified Security Approach To A...
 
NEW LAUNCH! Delivering Powerful Graphics-Intensive Applications from the AWS ...
NEW LAUNCH! Delivering Powerful Graphics-Intensive Applications from the AWS ...NEW LAUNCH! Delivering Powerful Graphics-Intensive Applications from the AWS ...
NEW LAUNCH! Delivering Powerful Graphics-Intensive Applications from the AWS ...
 
使用 Angular 2 與 Firebase 實現 Serverless 網站架構 (JSDC.tw 2016)
使用 Angular 2 與 Firebase 實現 Serverless 網站架構 (JSDC.tw 2016)使用 Angular 2 與 Firebase 實現 Serverless 網站架構 (JSDC.tw 2016)
使用 Angular 2 與 Firebase 實現 Serverless 網站架構 (JSDC.tw 2016)
 
使用 AWS Step Functions 開發 Serverless 服務
使用 AWS Step Functions 開發 Serverless 服務使用 AWS Step Functions 開發 Serverless 服務
使用 AWS Step Functions 開發 Serverless 服務
 
NEW LAUNCH! Additional transparency and control for your AWS environment thro...
NEW LAUNCH! Additional transparency and control for your AWS environment thro...NEW LAUNCH! Additional transparency and control for your AWS environment thro...
NEW LAUNCH! Additional transparency and control for your AWS environment thro...
 
AWS re:Invent 2016: Industry Opportunities for AWS Partners: Healthcare, Fina...
AWS re:Invent 2016: Industry Opportunities for AWS Partners: Healthcare, Fina...AWS re:Invent 2016: Industry Opportunities for AWS Partners: Healthcare, Fina...
AWS re:Invent 2016: Industry Opportunities for AWS Partners: Healthcare, Fina...
 
AWS re:Invent 2016: The Secret to SaaS (Hint: It's Identity) (GPSSI404)
AWS re:Invent 2016: The Secret to SaaS (Hint: It's Identity) (GPSSI404)AWS re:Invent 2016: The Secret to SaaS (Hint: It's Identity) (GPSSI404)
AWS re:Invent 2016: The Secret to SaaS (Hint: It's Identity) (GPSSI404)
 

Semelhante a NEW LAUNCH! Developing Serverless C# Applications

Semelhante a NEW LAUNCH! Developing Serverless C# Applications (20)

What's New with AWS Lambda
What's New with AWS LambdaWhat's New with AWS Lambda
What's New with AWS Lambda
 
Getting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless CloudGetting Started with AWS Lambda and the Serverless Cloud
Getting Started with AWS Lambda and the Serverless Cloud
 
Application Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless WorldApplication Lifecycle Management in a Serverless World
Application Lifecycle Management in a Serverless World
 
An introduction to serverless architectures (February 2017)
An introduction to serverless architectures (February 2017)An introduction to serverless architectures (February 2017)
An introduction to serverless architectures (February 2017)
 
A 60-mn tour of AWS compute (March 2016)
A 60-mn tour of AWS compute (March 2016)A 60-mn tour of AWS compute (March 2016)
A 60-mn tour of AWS compute (March 2016)
 
Deep Dive on AWS Lambda - January 2017 AWS Online Tech Talks
Deep Dive on AWS Lambda - January 2017 AWS Online Tech TalksDeep Dive on AWS Lambda - January 2017 AWS Online Tech Talks
Deep Dive on AWS Lambda - January 2017 AWS Online Tech Talks
 
Migrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
Migrate your Existing Express Apps to AWS Lambda and Amazon API GatewayMigrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
Migrate your Existing Express Apps to AWS Lambda and Amazon API Gateway
 
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
Serverless DevOps to the Rescue - SRV330 - re:Invent 2017
 
Deep Dive on Serverless Stack
Deep Dive on Serverless StackDeep Dive on Serverless Stack
Deep Dive on Serverless Stack
 
Building serverless app_using_aws_lambda_b4usolution
Building serverless app_using_aws_lambda_b4usolutionBuilding serverless app_using_aws_lambda_b4usolution
Building serverless app_using_aws_lambda_b4usolution
 
Building Serverless Backends with AWS Lambda and Amazon API Gateway
Building Serverless Backends with AWS Lambda and Amazon API GatewayBuilding Serverless Backends with AWS Lambda and Amazon API Gateway
Building Serverless Backends with AWS Lambda and Amazon API Gateway
 
Getting Started with AWS Lambda & Serverless Cloud
Getting Started with AWS Lambda & Serverless CloudGetting Started with AWS Lambda & Serverless Cloud
Getting Started with AWS Lambda & Serverless Cloud
 
Serverless Web Apps using API Gateway, Lambda and DynamoDB
Serverless Web Apps using API Gateway, Lambda and DynamoDBServerless Web Apps using API Gateway, Lambda and DynamoDB
Serverless Web Apps using API Gateway, Lambda and DynamoDB
 
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API GatewayStephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
 
Building serverless backends - Tech talk 5 May 2017
Building serverless backends - Tech talk 5 May 2017Building serverless backends - Tech talk 5 May 2017
Building serverless backends - Tech talk 5 May 2017
 
AWS Amplify
AWS AmplifyAWS Amplify
AWS Amplify
 
AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...
AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...
AWS August Webinar Series - Building Serverless Backends with AWS Lambda and ...
 
AWS Lambda and Serverless Cloud
AWS Lambda and Serverless CloudAWS Lambda and Serverless Cloud
AWS Lambda and Serverless Cloud
 
Eliminate repetitive work by using AWS Serverless Application Repository
Eliminate repetitive work by using AWS Serverless Application RepositoryEliminate repetitive work by using AWS Serverless Application Repository
Eliminate repetitive work by using AWS Serverless Application Repository
 
AWS Cloud Development Kit (CDK)를 이용한 코드 기반 인프라 개발 및 배포 - 공찬호(리얼리티매직) :: AWS C...
AWS Cloud Development Kit (CDK)를 이용한 코드 기반 인프라 개발 및 배포 - 공찬호(리얼리티매직) :: AWS C...AWS Cloud Development Kit (CDK)를 이용한 코드 기반 인프라 개발 및 배포 - 공찬호(리얼리티매직) :: AWS C...
AWS Cloud Development Kit (CDK)를 이용한 코드 기반 인프라 개발 및 배포 - 공찬호(리얼리티매직) :: AWS C...
 

Mais de Amazon Web Services

Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
Amazon Web Services
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
Amazon Web Services
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
Amazon Web Services
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
Amazon Web Services
 

Mais de Amazon Web Services (20)

Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
Come costruire servizi di Forecasting sfruttando algoritmi di ML e deep learn...
 
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
Big Data per le Startup: come creare applicazioni Big Data in modalità Server...
 
Esegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS FargateEsegui pod serverless con Amazon EKS e AWS Fargate
Esegui pod serverless con Amazon EKS e AWS Fargate
 
Costruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWSCostruire Applicazioni Moderne con AWS
Costruire Applicazioni Moderne con AWS
 
Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot Come spendere fino al 90% in meno con i container e le istanze spot
Come spendere fino al 90% in meno con i container e le istanze spot
 
Open banking as a service
Open banking as a serviceOpen banking as a service
Open banking as a service
 
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
Rendi unica l’offerta della tua startup sul mercato con i servizi Machine Lea...
 
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...OpsWorks Configuration Management: automatizza la gestione e i deployment del...
OpsWorks Configuration Management: automatizza la gestione e i deployment del...
 
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows WorkloadsMicrosoft Active Directory su AWS per supportare i tuoi Windows Workloads
Microsoft Active Directory su AWS per supportare i tuoi Windows Workloads
 
Computer Vision con AWS
Computer Vision con AWSComputer Vision con AWS
Computer Vision con AWS
 
Database Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatareDatabase Oracle e VMware Cloud on AWS i miti da sfatare
Database Oracle e VMware Cloud on AWS i miti da sfatare
 
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJSCrea la tua prima serverless ledger-based app con QLDB e NodeJS
Crea la tua prima serverless ledger-based app con QLDB e NodeJS
 
API moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e webAPI moderne real-time per applicazioni mobili e web
API moderne real-time per applicazioni mobili e web
 
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatareDatabase Oracle e VMware Cloud™ on AWS: i miti da sfatare
Database Oracle e VMware Cloud™ on AWS: i miti da sfatare
 
Tools for building your MVP on AWS
Tools for building your MVP on AWSTools for building your MVP on AWS
Tools for building your MVP on AWS
 
How to Build a Winning Pitch Deck
How to Build a Winning Pitch DeckHow to Build a Winning Pitch Deck
How to Build a Winning Pitch Deck
 
Building a web application without servers
Building a web application without serversBuilding a web application without servers
Building a web application without servers
 
Fundraising Essentials
Fundraising EssentialsFundraising Essentials
Fundraising Essentials
 
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
AWS_HK_StartupDay_Building Interactive websites while automating for efficien...
 
Introduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container ServiceIntroduzione a Amazon Elastic Container Service
Introduzione a Amazon Elastic Container Service
 

Último

Último (20)

Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

NEW LAUNCH! Developing Serverless C# Applications

  • 1. © 2016, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Norm Johanson & Steve Roberts December 1, 2016 DEV207 NEW LAUNCH! Serverless Development with C# and AWS Lambda
  • 2. What to Expect from the Session • Brief Introduction to AWS Lambda • Why .NET Core • New .NET Core Lambda tooling • Lots of exciting demos!
  • 3. AWS Lambda Crash Course • Compute part of the AWS serverless architecture • Zero administration • Event-driven scaling • Never pay for idle time • Upload your code and go
  • 4. Why .NET Core? • Performance • Modularized design • Low memory usage • Open Source • Built and validated for Amazon Linux • Allow AWS to respond to security issues • Cross Platform • Develop on any platform and run on Amazon Linux
  • 5. .NET Core Development • .NET Core 1.0 • https://www.microsoft.com/net/download/core • Visual Studio 2015 Update 3 • Visual Studio 2015 Tools (Preview 2) • Target framework netcoreapp1.0 • Package with .NET Core CLI “dotnet publish” • Upload as a zip file
  • 6. Declaring Lambda Functions • Static or instance methods • Must have a default constructor for instance methods • Can take 0 or 1 input parameters public void FunctionHandler() public void FunctionHandler(S3Event evnt) public string FunctionHandler(S3Event evnt, ILambdaContext context) • Optional ILambdaContext parameter
  • 7. • async methods must return a Task or Task<T> Declaring Lambda Functions public async Task FunctionHandler<T>(T obj, ILambdaContext context) public void FunctionHandler<T>(T obj, ILambdaContext context) • No generic methods public async Task FunctionHandler(S3Event evnt, ILambdaContext context) // return void public async Task<MyType> FunctionHandler(S3Event evnt, ILambdaContext context)
  • 9. Invoking from AWS Lambda Event Sources • Function executes in response to events in AWS services • A few of the supported services • Amazon S3 • Amazon DynamoDB • Amazon Kinesis • …. • Scheduled Events
  • 10. Invoking with the AWS SDKs • Invoke methods using any SDK • Great for mobile apps • Manage credentials with Amazon Cognito var client = new AmazonLambdaClient(cognitoCredentials, RegionEndpoint.USWest2); var request = new InvokeRequest { FunctionName = "ProcessGameScore", Payload = gameStats }; InvokeResponse response = await client.InvokeAsync(request);
  • 11. Invoking from Amazon API Gateway • Frontend of the AWS Serverless architecture • Expose Lambda functions as HTTP API • Manages authentication, versioning, monitoring and more
  • 14. Recap • Created a new Lambda project in Visual Studio • Learned how serialization works • Learned about the handler format • assemblyname::namespaced-classname::methodname • Published from Visual Studio • Configured AWS event source • Invoked the Lambda function from Visual Studio
  • 16. Yeoman Project Generators • Project generator ecosystem • Installable via npm: • Node.js dependency • npm install –g yo • AWS Lambda generators • npm install –g generator-aws-lambda-dotnet • yo aws-lambda-dotnet
  • 17. Recap Cross-Platform Demo • Created a project with Yeoman • npm install –g yo generator-aws-lambda-dotnet • yo aws-lambda-dotnet • Develop with any editor • Command line deployment with the .NET CLI and Amazon.Lambda.Tools NuGet package • dotnet lambda <command> <args> • In preview
  • 19. Demo Application Architecture internet GetBlogs() GetBlog() AddBlog() RemoveBlog() API Gateway AWS Lambda Amazon DynamoDB AWS CloudFormation Stack
  • 20. Our Serverless Application Deployment Visual Studio Project Amazon S3 AWS CloudFormation App bundle (.zip) Serverless template 2: Request stack …other resources Lambda Functions …other resources API Gateway 4: Stack launched 3: Fetch template
  • 21. Recap Serverless Application • Created an AWS Serverless application • Learned about the serverless.template file • Exposed Lambda functions as a HTTP API • Deployed using AWS CloudFormation
  • 22. ASP.NET Core and Web API • ASP.NET Core is the web framework for .NET Core • Includes framework for building Web API applications • Define API controllers to respond to requests • Maps request data to function parameters [Route("api/[controller]")] public class ValuesController : Controller { // PUT api/values/5 [HttpPut("{id}")] public void Put(int id, [FromBody]string value) { ... } ...
  • 23. How can we use ASP.NET Core in Lambda? • Amazon API Gateway Proxy Integration • Forwards all requests to a Lambda Function • Lambda Function • Converts how requests and responses are represented between API Gateway and ASP.NET Core • Implemented by Amazon.Lambda.AspNetCoreServer NuGet package • Currently in preview
  • 24. ASP.NET Core Web API Architecture IIS / Nginx Kestrel ASP.NET Core Hosting User’s Web API Controllers Internet
  • 25. ASP.NET Core Architecture on Lambda API Gateway Lambda ASP.NET Core Hosting User’s Web API Controllers Internet
  • 27. Recap ASP.NET Core Web API Demo • Used existing ASP.NET Core framework • No change to controller code • Used API Gateway Proxy Integration to forward all requests • Lambda function translates between API Gateway and ASP.NET Core • Amazon.Lambda.AspNetCoreServer NuGet Package • In preview • Looked at the handler source in GitHub
  • 28. Useful Links • AWS Toolkit for Visual Studio • https://aws.amazon.com/visualstudio/ • AWS Lambda .NET GitHub • https://github.com/aws/aws-lambda-dotnet • AWS .NET Developer Blog • https://aws.amazon.com/blogs/developer/category/net/ • AWS Lambda Developer Guide • http://docs.aws.amazon.com/lambda/latest/dg/welcome.html • AWS Toolkit for Visual Studio Guide • http://docs.aws.amazon.com/toolkit-for-visual- studio/latest/user-guide/welcome.html
  • 29. Other Related Sessions CMP211 - Getting Started with Serverless Architectures SRV202 – What’s New with AWS Lambda DEV301 - Amazon CloudWatch Logs and AWS Lambda: A Match Made in Heaven MBL306 - Serverless Authentication and Authorization: Identity Management for Serverless Architectures SVR311 - The State of Serverless Computing