SlideShare a Scribd company logo
From Zero to Serverless
Stir Trek
May 4, 2018
Chad Green
Who is Chad Green
• Data & Solutions Architect at ProgressiveHealth
• Community Involvement
• Code PaLOUsa Conference Chair
• Louisville .NET Meetup Organizer
• Louisville Tech Leaders Meetup Co-Organizer
• Louisville Tech Ladies Committee Member
• Contact Information
• chadgreen@chadgreen.com
• chadgreen.com
• ChadGreen
• ChadwickEGreen
From Zero to Serverless
What is Serverless Computing
From Zero to Serverless
From Zero to Serverless
The evolution of application platforms
5
On-
Premises
Which packages should
be on my server?
How do I deploy new
code to my servers?
How can I increase
server utilization?
How often should I
patch my servers?
What size of servers
should I buy?
Who has physical
access to my servers?
It takes how long to
provision a new server?
From Zero to Serverless
The evolution of application platforms
6
IaaS What is the right size of servers for my business needs?
How can I increase server utilization?
How many servers do I need?
How can I scale my application?
How do I deploy new code to my server?
Which Operating System should I use?
Who monitors my application?
How often should I patch my servers?
How often should I backup my server?
Which packages should be on my server?
From Zero to Serverless
The evolution of application platforms
7
PaaS What is the right size of servers for my business needs?
How can I increase server utilization?
How many servers do I need?
How can I scale my application?
From Zero to Serverless
The evolution of application platforms
8
Serverless
The platform for next generation
applications
From Zero to Serverless
What is Serverless?
9
• Applications that significantly or fully
depend on services (in the cloud) to
manage server-side logic and state
Area
#1
Area #2
• Application run in stateless compute
containers that are event-triggered,
ephemeral, and fully managed by a 3rd
party
Backend as a Service
(BaaS)
Functions as a Service
(FaaS)
From Zero to Serverless
What is Serverless?
10
Abstraction of
Servers
Event-Driven/Instant
Scale
Micro-Billing
From Zero to Serverless
Benefits of Serverless
11
Reduced DevOps Faster Time to
Market
Manage apps not
servers
From Zero to Serverless
Serverless Scale
12
Monolith
Microservice
Microservice
Microservice
Microservice
Function
Function
Function
Function
Function
Function
Function
Function
Function
Function
Function
Nano Services
From Zero to Serverless
Challenges of Serverless Architecture
13
Complexity
Organizational
Support
No Runtime
Optimization
Serverless Options
From Zero to Serverless
From Zero to Serverless
Serverless Options
15
• Zimki
• Google Cloud Functions
• Amazon Lambda
• IBM Cloud Functions
• Auth0 WebTask
• Azure
From Zero to Serverless
Azure Serverless
16
Functions
Execute your code based
on events you specify
Logic Apps
Design workflows and
orchestrate processes
Event Grid
Manage all events that
can trigger code or logic
From Zero to Serverless
Azure Serverless
17
Functions
Execute your code based
on events you specify
Logic Apps
Design workflows and
orchestrate processes
Event Grid
Manage all events that
can trigger code or logic
Storage Security IoT Analytics IntelligenceDatabase
Azure Functions
From Zero to Serverless
From Zero to Serverless
Azure Functions Architecture
19
App Service Dynamic Runtime
Hosting, CI, Deployment Slots, Remote Debugging, etc.
WebJobs Core
Programming model, common abstractions
WebJobs Extensions
Triggers, input, and output bindings
WebJobs Script Runtime
Azure Functions Host – Dynamic Compilation, Language abstractions, etc.
Language Runtime
C#, Node.js, F#, PHP, etc.
Code Config
From Zero to Serverless
Features of Azure Functions
20
• Choice of language
Batch
From Zero to Serverless
Features of Azure Functions
• Choice of language
• Pay-per-use pricing model
From Zero to Serverless
Features of Azure Functions
• Choice of language
• Pay-per-use pricing model
• Bring your own dependencies
From Zero to Serverless
Features of Azure Functions
• Choice of language
• Pay-per-use pricing model
• Bring your own dependencies
• Integrated security
From Zero to Serverless
Features of Azure Functions
24
• Choice of language
• Pay-per-use pricing model
• Bring your own dependencies
• Integrated security
• Simplified integration
From Zero to Serverless
Features of Azure Functions
25
• Choice of language
• Pay-per-use pricing model
• Bring your own dependencies
• Integrated security
• Simplified integration
• Flexible development
From Zero to Serverless
Features of Azure Functions
26
• Choice of language
• Pay-per-use pricing model
• Bring your own dependencies
• Integrated security
• Simplified integration
• Flexible development
• Open-source
From Zero to Serverless
What can you do with Functions
27
• Processing data, integrating systems, working with
IoT, simple API’s, and microservices
• Templates for a number of solution possibilities
From Zero to Serverless
Triggers and Bindings
28
Type
Schedule
HTTP (REST or webhook)
Blob Storage
Events
Queues
Queues and topics
Storage tables
SQL tables
NoSQL DB
Push Notifications
Twilio SMS Text
SendGrid email
Azure Functions
Service
Azure Functions
Azure Storage
Azure Event Hubs
Azure Storage
Azure Service Bus
Azure Storage
Azure Mobile Apps
Azure Cosmos DB
Azure Notification Hubs
Twilio
SendGrid
Trigger Input Output
From Zero to Serverless
Runtime Versions
29
• .NET Framework 4.6
• Generally Available
Runtime 1.x Runtime 2.x (Preview)
• .NET Core 2.0
• Cross Platform
From Zero to Serverless
Runtime Versions
30
• .NET Framework 4.6
• Generally Available
Runtime 1.x Runtime 2.x (Preview)
• .NET Core 2.0
• Cross Platform
• Language Extensions
• Java
From Zero to Serverless
Runtime Versions
31
• .NET Framework 4.6
• Generally Available
Runtime 1.x Runtime 2.x (Preview)
• .NET Core 2.0
• Cross Platform
• Language Extensions
• Java
• Binding Extensions
• Microsoft Graft
• Durable Functions
From Zero to Serverless
Develop How You Want
32
• Azure Portal
• Quickly get started without having to install anything
else
• Visual Studio 2017
• First class C# development experience
• Visual Studio Code
• First class Node.js development experience
• Edit any function project generated via CLI
• Azure Functions Core Tools (CLI)
• Build any kind of function and edit in IDE of your
choice
Demo 1: Create an Azure
Function from the Portal
Demo 2: Create an Azure
Function from Visual
Studio
From Zero to Serverless
Deployment and Monitoring
35
• Visual Studio
• Functions CLI
• Visual Studio Team Services
• Azure Resource Manager
• Maven / Jenkins
Deployment Options Monitoring Options
• Azure App Insights
• Function Logs
• Azure Monitor (preview)
Demo 3: CI/CD
From Zero to Serverless
Proxies
37
• Provide more control over all functions or just select
methods
• Can point to any HTTP resource
Take our current function url:
https://stirtrek.azurewebsites.net/api/HttpTriggerCSharp1?code=k9as3MKuDEA
Oyj3GbniZgJjWrn1cMqTAcDhbzqgAldUcYk67EX8QVg==&name=Stir%20Trek%
20Attendees
Our function URL would then be like this:
https://stirtrek.azurewebsites.net/HelloWorld/{name}
Demo 4: Setting up
routing and proxies
From Zero to Serverless
Securing your Azure Functions
39
• HTTPTriggers can be protected by OAuth providers
• Azure Active Directory
• Microsoft Account
• Facebook
• Google
• Twitter
From Zero to Serverless
Function Timeouts
40
• Default timeout of 5 minutes
• Maximum timeout of 10 minutes
• For longer running functions use the App Service
Plan and/or Durable Functions
Common Scenarios
From Zero to Serverless
From Zero to Serverless
Web Application Backends
42
From Zero to Serverless
Web Application Backends
43
From Zero to Serverless
Real-Time File Processing
44
From Zero to Serverless
Real-Time Stream Processing
45
From Zero to Serverless
Automation of Scheduled Tasks
46
From Zero to Serverless
Extending SaaS Applications
47
Pricing
From Zero to Serverless
From Zero to Serverless
Pricing – General Information
49
• No upfront cost
• No termination fees
• Pay only for what you use
From Zero to Serverless
Pricing – Two Different Pricing Plans
50
• Takes care of everything but your code
• Pay only when your functions are running
• Scale out automatically
Consumption Plan App Service Plan
• You pretty much take care of everything
• Consider when:
• Existing, underutilized VMs
• Function apps to run continuously
• More CPU or memory options
• Run longer than maximum execution
time
• Require features only available on
App Service plan
• Want to run on Linux (on general
availability tier)
From Zero to Serverless
Pricing – Consumption Plan Details
51
• Gigabyte-second (GB-s) – Combination of memory size and execution time
• Executions – Each time a function is executed
Meter Price Free Grant
Execution Time $0.000016 per Gb-s 400,000 GB-s
Executions $0.20 per million executions 1 million executions
From Zero to Serverless
Pricing – Consumption Plan Details
52
• Gigabyte-second (GB-s) – Combination of memory size and execution time
• Executions – Each time a function is executed
Meter Price Free Grant
Execution Time $0.000016 per Gb-s 400,000 GB-s
Executions $0.20 per million executions 1 million executions
Pricing Example
• Execution Time
• 3 million executions x 1 second per execution = 3 million seconds
• Resource consumption of 512-Mb  1.5 million GB-s
• 1.5 million GB-s minus grant of 400,000 Gb-s = 1.1 million Gb-s
• Execution Total = $17.60
• Executions
• 3 million executions minus grant of 1 million executions = 2 million executions
• 2 million transactions at 20 cents per million = $0.40
• Grand Total: $18.00
Best Practices
From Zero to Serverless
From Zero to Serverless
Best Practices
54
• Functions should do one thing
• Functions should be idempotent
• Functions should finish as quickly as possible
From Zero to Serverless
General Best Practices
55
• Avoid long running functions
From Zero to Serverless
General Best Practices
56
• Avoid long running functions
• Cross function communication
From Zero to Serverless
General Best Practices
57
• Avoid long running functions
• Cross function communication
• Write functions to be stateless
From Zero to Serverless
General Best Practices
58
• Avoid long running functions
• Cross function communication
• Write functions to be stateless
• Write defensive functions
From Zero to Serverless
Scalability Best Practices
59
• Do not mix test and production code in the same
function app
From Zero to Serverless
Scalability Best Practices
60
• Do not mix test and production code in the same
function app
• Use async code but avoid blocking calls
From Zero to Serverless
Scalability Best Practices
61
• Do not mix test and production code in the same
function app
• Use async code but avoid blocking calls
• Receive messages in batch whenever possible
From Zero to Serverless
Scalability Best Practices
62
• Do not mix test and production code in the same
function app
• Use async code but avoid blocking calls
• Receive messages in batch whenever possible
• Configure host behaviors to better handle
concurrency
From Zero to Serverless
Where to get started
63
• Start small, replace 1 API or background processing
item
• Integration is a great place, often it’s a new layer on
top of old layers
Summary
From Zero to Serverless
From Zero to Serverless
Summary
65
• With Azure Functions, the focus is on the code and not managing the
infrastructure
• Serverless architecture provides the following benefits:
• Reduced time to market
• Lower total cost of ownership
• Pay per execution
From Zero to Serverless
Azure Serverless Compute Summary
66
• It’s now becoming easier than ever to create small, targeted
microservice/nanoservice architecture using a variety of services
• Azure provides many services that can help you achieve a low-friction, high-
throughput and low-cost solution
• Azure Functions is just one in the serverless architecture family
Questions
chadgreen@chadgreen.com
chadgreen.com
ChadGreen
ChadwickEGreen
bit.ly/LDN0418

More Related Content

PPTX
Event Grid - quiet event to revolutionize Azure and more
PPTX
Creating Event Driven Applications with Azure Event Grid
PDF
Project Sherpa: How RightScale Went All in on Docker
PPTX
Cloud Bursting with A10 Lightning ADS
PPTX
How we accelerated our vault adoption with terraform
PDF
RightScale Webinar: Get Top Performance for Your Games
PPTX
Introduction to Azure Event Grid
PDF
Bringing DevOps to Routing with evolved XR: an overview
Event Grid - quiet event to revolutionize Azure and more
Creating Event Driven Applications with Azure Event Grid
Project Sherpa: How RightScale Went All in on Docker
Cloud Bursting with A10 Lightning ADS
How we accelerated our vault adoption with terraform
RightScale Webinar: Get Top Performance for Your Games
Introduction to Azure Event Grid
Bringing DevOps to Routing with evolved XR: an overview

What's hot (20)

PDF
AWS for Java Developers workshop
PPTX
Build Serverless applications with Azure Event Grid
PDF
Bol.com Tech lab September 2017 - Microservices in action at the Dutch Nation...
PDF
What Every MSP Needs to Know for Cloud Success
PDF
Compare Clouds: Aws vs Azure vs Google vs SoftLayer
PDF
O365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf
PDF
Netflix Cloud Platform and Open Source
PPTX
Ibm cloud nativenetflixossfinal
PDF
O365Con19 - Things I've Learned While Building a Product on SharePoint Modern...
PDF
Overcoming 5 Common Docker Challenges: How We Do It at RightScale
PPTX
NextGen IBM Cloud Monitoring and Logging
PDF
Network Infrastructure as Code with Chef and Cisco
PPTX
Asynchronous design with Spring and RTI: 1M events per second
PPTX
Serverless IoT with AWS Lambda
PPTX
How Serverless Changes DevOps
PDF
Splunk Spark Integration
PDF
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
PPTX
Scale your application to new heights with NGINX and AWS
PPTX
From Serverless to InterCloud
PPTX
From Dev to Ops:Delivering an API to Production with Splunk
AWS for Java Developers workshop
Build Serverless applications with Azure Event Grid
Bol.com Tech lab September 2017 - Microservices in action at the Dutch Nation...
What Every MSP Needs to Know for Cloud Success
Compare Clouds: Aws vs Azure vs Google vs SoftLayer
O365Con19 - Sharing Code Efficiently in your Organisation - Elio Struyf
Netflix Cloud Platform and Open Source
Ibm cloud nativenetflixossfinal
O365Con19 - Things I've Learned While Building a Product on SharePoint Modern...
Overcoming 5 Common Docker Challenges: How We Do It at RightScale
NextGen IBM Cloud Monitoring and Logging
Network Infrastructure as Code with Chef and Cisco
Asynchronous design with Spring and RTI: 1M events per second
Serverless IoT with AWS Lambda
How Serverless Changes DevOps
Splunk Spark Integration
Cloudsolutionday 2016: DevOps workflow with Docker on AWS
Scale your application to new heights with NGINX and AWS
From Serverless to InterCloud
From Dev to Ops:Delivering an API to Production with Splunk
Ad

Similar to From Zero to Serverless (20)

PPTX
From Zero to Serverless (DogFoodCon 2018)
PPTX
From Zero to Serverless (CoderCruise 2018)
PPTX
Azure Functions Real World Examples
PDF
Going serverless with azure functions
PPTX
Serverless: The future of application delivery
PPTX
Azure functions
PPTX
Going serverless
PPTX
Go Serverless with Cosmos DB, Azure Functions and Blazor
PPTX
Public v1 real world example of azure functions serverless conf london 2016
PPTX
Serverless on Azure with Functions
PPTX
SERVERS? WHERE WE'RE GOING, WE DON'T NEED SERVERS.
PDF
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...
PDF
Azure Serverless Toolbox
PPTX
GIDS 2019: Developing Apps with Containers, Functions and Cloud Services
PPTX
Azure full
PDF
Azure for AWS & GCP Pros: Which Azure services to use?
PPTX
#SpFestSea azr203 Azure functions lessons learned
PPTX
Serverless architecture with Azure
PDF
Serverless Computing with Azure
PPTX
Serverless in the Azure World
From Zero to Serverless (DogFoodCon 2018)
From Zero to Serverless (CoderCruise 2018)
Azure Functions Real World Examples
Going serverless with azure functions
Serverless: The future of application delivery
Azure functions
Going serverless
Go Serverless with Cosmos DB, Azure Functions and Blazor
Public v1 real world example of azure functions serverless conf london 2016
Serverless on Azure with Functions
SERVERS? WHERE WE'RE GOING, WE DON'T NEED SERVERS.
GlobalLogic .NET Community Webinar #3 "Exploring Serverless with Azure Functi...
Azure Serverless Toolbox
GIDS 2019: Developing Apps with Containers, Functions and Cloud Services
Azure full
Azure for AWS & GCP Pros: Which Azure services to use?
#SpFestSea azr203 Azure functions lessons learned
Serverless architecture with Azure
Serverless Computing with Azure
Serverless in the Azure World
Ad

More from Chad Green (7)

PPTX
Getting Started with Azure SQL Database (Presented at Pittsburgh TechFest 2018)
PPTX
Secrets of Conflict Resolution (Presented at Music City Agile 2018)
PPTX
Secrets of Conflict Resolution (Nebraska.Code)
PPTX
How to be a Leader (Nebraska.Code)
PPTX
Careers in software development
PPTX
A Lap Around Visual Studio 11
PPTX
Tfs Overview
Getting Started with Azure SQL Database (Presented at Pittsburgh TechFest 2018)
Secrets of Conflict Resolution (Presented at Music City Agile 2018)
Secrets of Conflict Resolution (Nebraska.Code)
How to be a Leader (Nebraska.Code)
Careers in software development
A Lap Around Visual Studio 11
Tfs Overview

Recently uploaded (20)

PPTX
Odoo POS Development Services by CandidRoot Solutions
PPTX
history of c programming in notes for students .pptx
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
System and Network Administration Chapter 2
PPTX
Introduction to Artificial Intelligence
PDF
Complete React Javascript Course Syllabus.pdf
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
top salesforce developer skills in 2025.pdf
PPT
Introduction Database Management System for Course Database
PDF
AI in Product Development-omnex systems
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PPTX
ai tools demonstartion for schools and inter college
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
medical staffing services at VALiNTRY
PPTX
Online Work Permit System for Fast Permit Processing
Odoo POS Development Services by CandidRoot Solutions
history of c programming in notes for students .pptx
VVF-Customer-Presentation2025-Ver1.9.pptx
System and Network Administration Chapter 2
Introduction to Artificial Intelligence
Complete React Javascript Course Syllabus.pdf
ISO 45001 Occupational Health and Safety Management System
How to Migrate SBCGlobal Email to Yahoo Easily
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Internet Downloader Manager (IDM) Crack 6.42 Build 41
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
top salesforce developer skills in 2025.pdf
Introduction Database Management System for Course Database
AI in Product Development-omnex systems
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
ai tools demonstartion for schools and inter college
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
medical staffing services at VALiNTRY
Online Work Permit System for Fast Permit Processing

From Zero to Serverless

  • 1. From Zero to Serverless Stir Trek May 4, 2018 Chad Green
  • 2. Who is Chad Green • Data & Solutions Architect at ProgressiveHealth • Community Involvement • Code PaLOUsa Conference Chair • Louisville .NET Meetup Organizer • Louisville Tech Leaders Meetup Co-Organizer • Louisville Tech Ladies Committee Member • Contact Information • chadgreen@chadgreen.com • chadgreen.com • ChadGreen • ChadwickEGreen
  • 4. What is Serverless Computing From Zero to Serverless
  • 5. From Zero to Serverless The evolution of application platforms 5 On- Premises Which packages should be on my server? How do I deploy new code to my servers? How can I increase server utilization? How often should I patch my servers? What size of servers should I buy? Who has physical access to my servers? It takes how long to provision a new server?
  • 6. From Zero to Serverless The evolution of application platforms 6 IaaS What is the right size of servers for my business needs? How can I increase server utilization? How many servers do I need? How can I scale my application? How do I deploy new code to my server? Which Operating System should I use? Who monitors my application? How often should I patch my servers? How often should I backup my server? Which packages should be on my server?
  • 7. From Zero to Serverless The evolution of application platforms 7 PaaS What is the right size of servers for my business needs? How can I increase server utilization? How many servers do I need? How can I scale my application?
  • 8. From Zero to Serverless The evolution of application platforms 8 Serverless The platform for next generation applications
  • 9. From Zero to Serverless What is Serverless? 9 • Applications that significantly or fully depend on services (in the cloud) to manage server-side logic and state Area #1 Area #2 • Application run in stateless compute containers that are event-triggered, ephemeral, and fully managed by a 3rd party Backend as a Service (BaaS) Functions as a Service (FaaS)
  • 10. From Zero to Serverless What is Serverless? 10 Abstraction of Servers Event-Driven/Instant Scale Micro-Billing
  • 11. From Zero to Serverless Benefits of Serverless 11 Reduced DevOps Faster Time to Market Manage apps not servers
  • 12. From Zero to Serverless Serverless Scale 12 Monolith Microservice Microservice Microservice Microservice Function Function Function Function Function Function Function Function Function Function Function Nano Services
  • 13. From Zero to Serverless Challenges of Serverless Architecture 13 Complexity Organizational Support No Runtime Optimization
  • 15. From Zero to Serverless Serverless Options 15 • Zimki • Google Cloud Functions • Amazon Lambda • IBM Cloud Functions • Auth0 WebTask • Azure
  • 16. From Zero to Serverless Azure Serverless 16 Functions Execute your code based on events you specify Logic Apps Design workflows and orchestrate processes Event Grid Manage all events that can trigger code or logic
  • 17. From Zero to Serverless Azure Serverless 17 Functions Execute your code based on events you specify Logic Apps Design workflows and orchestrate processes Event Grid Manage all events that can trigger code or logic Storage Security IoT Analytics IntelligenceDatabase
  • 18. Azure Functions From Zero to Serverless
  • 19. From Zero to Serverless Azure Functions Architecture 19 App Service Dynamic Runtime Hosting, CI, Deployment Slots, Remote Debugging, etc. WebJobs Core Programming model, common abstractions WebJobs Extensions Triggers, input, and output bindings WebJobs Script Runtime Azure Functions Host – Dynamic Compilation, Language abstractions, etc. Language Runtime C#, Node.js, F#, PHP, etc. Code Config
  • 20. From Zero to Serverless Features of Azure Functions 20 • Choice of language Batch
  • 21. From Zero to Serverless Features of Azure Functions • Choice of language • Pay-per-use pricing model
  • 22. From Zero to Serverless Features of Azure Functions • Choice of language • Pay-per-use pricing model • Bring your own dependencies
  • 23. From Zero to Serverless Features of Azure Functions • Choice of language • Pay-per-use pricing model • Bring your own dependencies • Integrated security
  • 24. From Zero to Serverless Features of Azure Functions 24 • Choice of language • Pay-per-use pricing model • Bring your own dependencies • Integrated security • Simplified integration
  • 25. From Zero to Serverless Features of Azure Functions 25 • Choice of language • Pay-per-use pricing model • Bring your own dependencies • Integrated security • Simplified integration • Flexible development
  • 26. From Zero to Serverless Features of Azure Functions 26 • Choice of language • Pay-per-use pricing model • Bring your own dependencies • Integrated security • Simplified integration • Flexible development • Open-source
  • 27. From Zero to Serverless What can you do with Functions 27 • Processing data, integrating systems, working with IoT, simple API’s, and microservices • Templates for a number of solution possibilities
  • 28. From Zero to Serverless Triggers and Bindings 28 Type Schedule HTTP (REST or webhook) Blob Storage Events Queues Queues and topics Storage tables SQL tables NoSQL DB Push Notifications Twilio SMS Text SendGrid email Azure Functions Service Azure Functions Azure Storage Azure Event Hubs Azure Storage Azure Service Bus Azure Storage Azure Mobile Apps Azure Cosmos DB Azure Notification Hubs Twilio SendGrid Trigger Input Output
  • 29. From Zero to Serverless Runtime Versions 29 • .NET Framework 4.6 • Generally Available Runtime 1.x Runtime 2.x (Preview) • .NET Core 2.0 • Cross Platform
  • 30. From Zero to Serverless Runtime Versions 30 • .NET Framework 4.6 • Generally Available Runtime 1.x Runtime 2.x (Preview) • .NET Core 2.0 • Cross Platform • Language Extensions • Java
  • 31. From Zero to Serverless Runtime Versions 31 • .NET Framework 4.6 • Generally Available Runtime 1.x Runtime 2.x (Preview) • .NET Core 2.0 • Cross Platform • Language Extensions • Java • Binding Extensions • Microsoft Graft • Durable Functions
  • 32. From Zero to Serverless Develop How You Want 32 • Azure Portal • Quickly get started without having to install anything else • Visual Studio 2017 • First class C# development experience • Visual Studio Code • First class Node.js development experience • Edit any function project generated via CLI • Azure Functions Core Tools (CLI) • Build any kind of function and edit in IDE of your choice
  • 33. Demo 1: Create an Azure Function from the Portal
  • 34. Demo 2: Create an Azure Function from Visual Studio
  • 35. From Zero to Serverless Deployment and Monitoring 35 • Visual Studio • Functions CLI • Visual Studio Team Services • Azure Resource Manager • Maven / Jenkins Deployment Options Monitoring Options • Azure App Insights • Function Logs • Azure Monitor (preview)
  • 37. From Zero to Serverless Proxies 37 • Provide more control over all functions or just select methods • Can point to any HTTP resource Take our current function url: https://stirtrek.azurewebsites.net/api/HttpTriggerCSharp1?code=k9as3MKuDEA Oyj3GbniZgJjWrn1cMqTAcDhbzqgAldUcYk67EX8QVg==&name=Stir%20Trek% 20Attendees Our function URL would then be like this: https://stirtrek.azurewebsites.net/HelloWorld/{name}
  • 38. Demo 4: Setting up routing and proxies
  • 39. From Zero to Serverless Securing your Azure Functions 39 • HTTPTriggers can be protected by OAuth providers • Azure Active Directory • Microsoft Account • Facebook • Google • Twitter
  • 40. From Zero to Serverless Function Timeouts 40 • Default timeout of 5 minutes • Maximum timeout of 10 minutes • For longer running functions use the App Service Plan and/or Durable Functions
  • 41. Common Scenarios From Zero to Serverless
  • 42. From Zero to Serverless Web Application Backends 42
  • 43. From Zero to Serverless Web Application Backends 43
  • 44. From Zero to Serverless Real-Time File Processing 44
  • 45. From Zero to Serverless Real-Time Stream Processing 45
  • 46. From Zero to Serverless Automation of Scheduled Tasks 46
  • 47. From Zero to Serverless Extending SaaS Applications 47
  • 48. Pricing From Zero to Serverless
  • 49. From Zero to Serverless Pricing – General Information 49 • No upfront cost • No termination fees • Pay only for what you use
  • 50. From Zero to Serverless Pricing – Two Different Pricing Plans 50 • Takes care of everything but your code • Pay only when your functions are running • Scale out automatically Consumption Plan App Service Plan • You pretty much take care of everything • Consider when: • Existing, underutilized VMs • Function apps to run continuously • More CPU or memory options • Run longer than maximum execution time • Require features only available on App Service plan • Want to run on Linux (on general availability tier)
  • 51. From Zero to Serverless Pricing – Consumption Plan Details 51 • Gigabyte-second (GB-s) – Combination of memory size and execution time • Executions – Each time a function is executed Meter Price Free Grant Execution Time $0.000016 per Gb-s 400,000 GB-s Executions $0.20 per million executions 1 million executions
  • 52. From Zero to Serverless Pricing – Consumption Plan Details 52 • Gigabyte-second (GB-s) – Combination of memory size and execution time • Executions – Each time a function is executed Meter Price Free Grant Execution Time $0.000016 per Gb-s 400,000 GB-s Executions $0.20 per million executions 1 million executions Pricing Example • Execution Time • 3 million executions x 1 second per execution = 3 million seconds • Resource consumption of 512-Mb  1.5 million GB-s • 1.5 million GB-s minus grant of 400,000 Gb-s = 1.1 million Gb-s • Execution Total = $17.60 • Executions • 3 million executions minus grant of 1 million executions = 2 million executions • 2 million transactions at 20 cents per million = $0.40 • Grand Total: $18.00
  • 53. Best Practices From Zero to Serverless
  • 54. From Zero to Serverless Best Practices 54 • Functions should do one thing • Functions should be idempotent • Functions should finish as quickly as possible
  • 55. From Zero to Serverless General Best Practices 55 • Avoid long running functions
  • 56. From Zero to Serverless General Best Practices 56 • Avoid long running functions • Cross function communication
  • 57. From Zero to Serverless General Best Practices 57 • Avoid long running functions • Cross function communication • Write functions to be stateless
  • 58. From Zero to Serverless General Best Practices 58 • Avoid long running functions • Cross function communication • Write functions to be stateless • Write defensive functions
  • 59. From Zero to Serverless Scalability Best Practices 59 • Do not mix test and production code in the same function app
  • 60. From Zero to Serverless Scalability Best Practices 60 • Do not mix test and production code in the same function app • Use async code but avoid blocking calls
  • 61. From Zero to Serverless Scalability Best Practices 61 • Do not mix test and production code in the same function app • Use async code but avoid blocking calls • Receive messages in batch whenever possible
  • 62. From Zero to Serverless Scalability Best Practices 62 • Do not mix test and production code in the same function app • Use async code but avoid blocking calls • Receive messages in batch whenever possible • Configure host behaviors to better handle concurrency
  • 63. From Zero to Serverless Where to get started 63 • Start small, replace 1 API or background processing item • Integration is a great place, often it’s a new layer on top of old layers
  • 64. Summary From Zero to Serverless
  • 65. From Zero to Serverless Summary 65 • With Azure Functions, the focus is on the code and not managing the infrastructure • Serverless architecture provides the following benefits: • Reduced time to market • Lower total cost of ownership • Pay per execution
  • 66. From Zero to Serverless Azure Serverless Compute Summary 66 • It’s now becoming easier than ever to create small, targeted microservice/nanoservice architecture using a variety of services • Azure provides many services that can help you achieve a low-friction, high- throughput and low-cost solution • Azure Functions is just one in the serverless architecture family

Editor's Notes

  • #6: Get Hardware Get and install Operating System Get and install application framework (No Click) Deploy code to the server Host all of this somewhere in your datacenter (No Click) Bunch of questions Backup for your apps Physical Security Scaling Up Monitoring (hardware and application) And so on Realy important question – but not key to core competency
  • #7: Infrastructure as a Service
  • #8: Platform as a Service A lot of decisions are easily configurable (Click) But still have to think about how to scale
  • #9: Only Problem: How to build your app to best solve business problem?
  • #10: Like many trends in software there is no one clear view of what ‘Serverless’ is, and that is not helped by it really coming to mean two different but overlapping areas. Area #1 – Serverless was first used to describe applications that significantly or fully depended on 3rd party applications or services (“in the cloud”) to manage server-side logic and state. These are typically “rich client” applications (think single page web apps or mobile apps) that use the vast ecosystem of cloud accessible databases, authentication services, etc. <CLICK> These type of services are better referred to as Backend as a Service (BaaS) Area #2 – Serverless can also mean applications where some amount of server-side logic is still written by the application developer but unlike traditional architectures is run in stateless compute containers that are event-triggered, ephemeral (may only last for one invocation), and fully managed by a third party. <CLICK> One way to think of this is Function as a Service (FaaS).
  • #13: Monolith Microservices Functions  Nano Services
  • #14: Complexity: Managing a monolithic application as a single unit is more straightforward than managing a fleet of purpose-built functions and the dependencies between them. Organization Support: It’s a non-trivial consideration for some to move to a serverless paradigm No Runtime Optimization: By its very nature, you mostly do not have control over the execution environment for the workload.
  • #16: The first “pay as you go” code execution platform was Zimki, released in 2006, <click>but it was not commercially successful – domain is for sale Google Cloud Functions : Event-driven serverless compute platform AWS Lambda : Run code without thinking about servers. Pay only for the compute time you consume. IBM Cloud Functions: Based on Apache OpenWhisk, IBM Cloud Functions is a polyglot function-as-a-service programming platform for developing lightweight code that scalably executes on demand Auth0 WebTask: All you need is code
  • #17: Azure Functions is an event-driven compute experience that allows you to execute your code, written in the programming language of your choice, without worrying about servers. Benefit from scale on demand and never pay for idle capacity. Logic Apps provides serverless workflows that allow developers to easily integrate data with their apps instead of writing complex glue code between disparate systems. Logic Apps also allow you to orchestrate and connect the serverless functions and APIs of your application. Event Grid is a fully managed event routing service that enables rich application scenarios by connecting serverless logic to event coming from multiple Azure services or from your own apps.
  • #18: Backend as a Service Azure Databases deliver a database ally for your serverless app. Azure SQL, MySQL, and Progress provide industry standard database capabilities. Cosmos DB is a multi-model database service that provides transparent scaling and replication of your data to wherever your users are. Azure Storage provides durable, highly available, and massively scalable cloud storage to developers for cloud applications. Get options for unstructured object data, structured datasets, file storage, and queue storage for serverless communication between cloud apps. Azure Active Directory provides cloud-based identity and access management. Using it, developers can securely control access to resources and manage and authenticate the users of their serverless apps. IoT Azure Stream Analytics is a fully managed analytics service for real-life streaming data. It allows you to author queries in simple, declarative, SQL-like language, and you only pay for the processing used per job. Event hubs is a fully managed service that simplifies mass ingestion of small data inputs, typically from devices and sensors, to process, route, and store the data. Azure Bot Service allows you to build intelligent serverless bots that can interact with your users contextually through multiple channels like text/SMS, Skype, Microsoft Teams, Slack, Office 365, Twitter, and other popular services. Cognitive Services allows you to easily add intelligent features such as emotion and sentiment detection, vision, and speech recognition, language understanding, and knowledge and search – into your app. Using these services through serverless code or logic workflows minimizes the learning curve for creating intelligent apps.
  • #20: Cake Diagram Azure Functions are built on top of Azure App Service and WebJobs SDK
  • #21: Choice of language: Azure Functions is a polyglot solution which allows you to write functions in not just C#, F#, and JavaScript, but also Java, Python, PHP, TypeScript, Batch, Bash, and PowerShell
  • #22: Pay-per-use pricing model: Pay for only the time spent running your code. Azure Functions consumption plan is based on per-second resource consumption and executions.
  • #23: Bring your own dependencies: Functions support both NuGet and NPM, so you can use your favorite libraries.
  • #24: Integrated security: Protect HTTP-triggered functions with OAuth providers such as Azure Active Directory, Facebook, Google, Twitter, and Microsoft Account.
  • #25: Simplified integration: Easily leverage Azure services and software-as-a-service (SaaS) offerings. These services can trigger your function and start execution or they can serve as input and output for your code. Such services include Cosmos DB, Event Hubs, Event Grid, Mobile Apps, Notification Hubs, Service Bus, Azure Storage, GitHub, and Twilio SMS messages
  • #26: Flexible development: Code your functions right in the portal or set up continuous integration and deploy your code through GitHub, Visual Studio Team Services, and other support development tools including OneDrive, Bitbucket, Dropbox, and either a local or external Git repository
  • #27: Open-source: The Functions runtime is open-source and available on GitHub
  • #28: Grate for processing data, integrating systems, working with IoT, simple API’s, and microservices There are a number of templates that can get you started in a lot of different possibilities
  • #29: Key with Azure Functions is that is supports Triggers to start execution Bindings to simplify code for input and output of data
  • #30: There are two major versions of the Azure Functions runtime: 1.x and 2.x Cross-platform development: Runtime 1.x support development and hosting only in the portal or on Windows. Runtime 2.x runs on .NET Core, which means it can run on all platforms supported by .NET Core, including macOS and Linux. This enables cross-platform development and hosting scenarios that are not possible with 1.x.
  • #31: Languages: Runtime 2.x uses a new language extensibility model. Initially, JavaScript and Java are taking advantage of this new model. Azure Functions 1.x experimental languages have not been updated to use the new model, so they are not supported in 2.x. The experimental languages are Python, PHP, TypeScript, Batch, Bash, and PowerShell.
  • #32: Runtime 2.x uses a new binding extensibility model that offers several advantages: Support for third-party binding extensions Decoupling of runtime and bindings. This allows binding extensions to be versioned and released independently. You can, for example, opt to upgrade to a version of an extension that relies on a new version of an underlying SDK. A lighter execution environment, where only the bindings in use are known and loaded by the runtime Microsoft Graph bindings – allow you work with data, insights and events from the Microsoft Graph. Use the Microsoft Graph API to connect to the data that drives productivity – mail, calendar, contacts, documents, directory, devices, and more. Durable Functions is an extension of Azure Functions and Azure WebJobs that lets you write stateful functions in a serverless environment. The extension manages state, checkpoints, and restarts for you.
  • #33: Four different tools you can use to work with Azure Functions Azure Portal – Quickly get started without having to install anything else Visual Studio 2017 – First class C# development experience Visual Studio Code – First Class Node.js development experience plus you can edit any function project generated via the CLI Azure Functions Core Tools (CLI) – Build any kind of function and edit in IDE of your choice
  • #38: Azure Functions Proxies allows you to forward requests to other resource. You define an HTTP endpoint just like the HTTP trigger, but instead of writing code to execute when the endpoint is called, you provide a URL to a remote implementation. This allows you to compose multiple API sources into a single API surface which is easy for clients to consume. This is particularly useful if you wish to build your API as microservices (or nanoservices). A proxy can point to any HTTP resource, such as: Azure Functions API apps in Azure App Service Docker containers in App Service on Linux Any other hosted API Routing
  • #40: Azure Functions Proxies allows you to forward requests to other resource. You define an HTTP endpoint just like the HTTP trigger, but instead of writing code to execute when the endpoint is called, you provide a URL to a remote implementation. This allows you to compose multiple API sources into a single API surface which is easy for clients to consume. This is particularly useful if you wish to build your API as microservices (or nanoservices). A proxy can point to any HTTP resource, such as: Azure Functions API apps in Azure App Service Docker containers in App Service on Linux Any other hosted API Routing
  • #41: Consumption Plan restrictions The timeout value can be changed by changing the functionTimeout property in host.json Durable Functions is an extension of Azure Functions and Azure WebJobs that lets you write stateful functions in a serverless environment. The extension manages state, checkpoints, and restarts for you.
  • #43: Online orders are picked up for a queue, processed, and the resulting data is stored in a database
  • #44: Colleagues use mobile backing to reimburse each other for lunch; the person who paid for lunch requests payment through his mobile app, triggering a notification on his colleagues’ phone.
  • #45: Patient records are securely uploaded as PDF files. That data is then decomposed, processed using OCR detection, and added to a database for easy queries.
  • #46: Huge amounts of telemetry data is collected from a massive cloud app. That data is processed in near real-time and stored in a DB for use in an analytics dashboard.
  • #47: A customer database is analyzed for duplicate entries every 15 minutes, to avoid multiple communications being sent out to the same customers.
  • #48: A SaaS solution provides extensibility through webhooks, which can be implemented through Functions, to automate certain workflows.
  • #51: You can run Azure functions in two different modes <click>: Consumption plan and App Service plan. The Consumption plan automatically allocates compute power when you code is running, scales out as necessary to handle power when your code is running, scales out as necessary to handle load, and then scales down when code is not running. You do not have to pay for idle VMs and do not have to reserve capacity in advanced. In the App Service plan, your function apps run on dedicated virtual machines similar to Web Apps. <CLICK> Basically the Consumption plan takes care of everything but your code for you; whereas the App Service plan requires you to handle at least the configuration of all that. The Consumption plan is the default hosting plan and offers the following benefits: Pay only when your functions are running Scale out automatically, even during periods of high load Consider an App Service plan in the following cases: You have existing, underutilized VMs that are already running other App Service instances You expect your function apps to run continuously, or nearly continuously. In this case, an App Service Plan can be more cost-effective. You need more CPU or memory options than what is provided on the Consumption plan You need to run longer than the maximum execution time allowed on the Consumption plan (of 10 minutes) You require features that are only available on an App Service plan, such as support for App Service Environment, VNET/CPN connectivity, and larger VM sizes You want to run your function app on Linux, or you want to provide a custom image on which to run your functions
  • #52: Usage is aggregated at the function app level and counts only the time that function code is executed. Azure bills using two different units: Resource consumption in gigabyte-seconds (GB-s). Computed as a combination of memory size and execution time for all functions within a function app. So if a function uses 512-Mb of memory and runs for 1 seconds, then each execution uses 0.5 GB-s. Executions: Counted each time a function is executed in response to an event trigger.
  • #53: Pricing Example: A function with observed memory consumption of 512-Mb executes 3,000,000 times during the month and has an execution duration of one second. Monthly billing would be calculated as follows: <CLICK> Resource Consumption Billing Calculation 3 million executions x 1 second per execution equals 3 million seconds If the resource consumption is 512-Mb over 3 million seconds; you get 1.5 million GB-s There is a monthly free grant of 400,000 GB-s, so that reduces our scenario to 1.1 million GB-s to be charged for Resource consumption is charged at $0.000016/GB-s; so that would come out to $17.60 Execution billing calculation There were 3 million execution and Microsoft gives you 1 million free executions a month So we are billed for 2 million executions at 20 cents per million executions; so that would be 40 cents Total consumption billing calculation So when you add the $17.60 from resource consumption cost and 40 cents for the execution cost; our total month bill is $18.00
  • #54: The following are best practices in how you build and architect your serverless solutions using Azure Functions.
  • #55: Idempotent – Clients can make the same call repeatedly while producing the same result. In other words, making multiple identical requests has the same effect as making a single request. Note that while idempotent operations produce the same result on the server (no side effects), the response itself may not be the same – a source’s state may change between requests.
  • #56: Large, long-running functions can cause unexpected timeout issues. A function can become large due to many Node.js dependencies. Importing dependencies can also cause increased load times that results in unexpected timeouts. Dependencies are loaded both explicitly and implicitly. A single module loaded by your code may load its own additional modules. Whenever possible, refactor large functions into smaller function sets that work together and return responses fast. For example, a webhook or HTTP trigger might require an acknowledgment response within a certain time limit; it is common for webhooks to require an immediate response. You can pass the HTTP trigger payload into a queue to be processed by a queue trigger function. This approach allows you to defer the actual work and turn an immediate response.
  • #57: Durable Functions and Azure Logic Apps are built to manage state transitions and communication between multiple functions. If not using Durable Functions or Logic Apps to integrate with multiple functions, it is generally a best practice to use storage queues for cross function communication. The main reason is storage queues are cheaper and much easier to provision. Individual messages in a storage queue are limited in size to 64-KB. If you need to pass larger message between functions, an Azure Service Bus queue could be used to support message sizes up to 256-Kb in the Standard tier, and up to 1-Mb in the Premier tier. Service Bus topics are useful if you require message filtering before processing. Event hubs are useful to support high volume communications.
  • #58: Functions should be stateless and idempotent if possible. Associate any required state information with your data. For example, an order being processed would likely have an associated state member. A function could process an order based on that state while the function itself remains stateless. Idempotent functions are especially recommended with timer triggers. For example, if you have something that absolutely must run once a day, write it so it can run any time during the day with the same results. The function can exit when there is no work for a particular day. Also if a previous run failed to complete, the next run should pick up where it left off.
  • #59: Assume your function could encounter an exception at any time. Design your functions with the ability to continue from a previous fail point during the next execution. Consider a scenario that requires the following actions: Query for 10,000 rows in a database. Create a queue message for each of those rows to process further down the line. Depending on how complex your system is, you may have: involved downstream services behaving badly, network outages, or quota limits reached, etc. All of these can affect your function at any time, You need to design your functions to be prepared for it. How does your code react if a failure occurs after inserting 5,000 of those items into a queue for processing? Track items in a set that you have completed. Otherwise, you might insert them again next time. This can have a serios impact on your workflow. If a queue item has already processed, allow your function to be a no-op.
  • #60: There are a number of factors which impact how instances of your function app scale. The following are some best practices to ensure optimal scalability of a function app. Functions within a function app share resource. For example, memory is shared. If you are using a function app in production, do not add test-related functions and resource to it. It can cause unexpected overhead during production code execution. Be careful of what you load in your production function apps. Memory is averaged across each function in the app. Do not use verbose logging in production code – it has a negative performance impact.
  • #61: Asynchronous programming is a recommended best practice. However, always avoid referencing the Result property or calling the Wait method on a Task instance. This approach can lead to thread exhaustion.
  • #62: Some triggers like Event Hub enable receiving a batch of messages on a single invocation. Batching messages has much better performance.
  • #63: The host.json file in the function app allows for configuration of host runtime and trigger behaviors. In addition to batching behaviors, you can manage concurrency for a number of triggers. Often adjusting the values in these options can help each instance scale appropriately for the demands of the invoked functions. Settings in the hosts file apply across all functions within the app, within a single instance of the function. For example, if you had a function app with 2 HTTP functions and a concurrent request set to 25, a request to either HTTP trigger would count towards 25 concurrent requests. If that function app scaled to 10 instances, the 2 functions would effectively allow 250 concurrent requests (10 instances * 25 concurrent requests per instance).