SlideShare a Scribd company logo
1 of 40
1
www.techtalk.at
Raoul Holzer
Andreas Willich
Serverless with Azure Functions
2
What is a serverless architecture?
What is serverless on Azure?
What are Azure Functions?
What can they do?
How do I develop Azure Functions?
How the heck can I deploy the stuff?
Questions to be answered
3
Serverless Architecture
4
Who heard about it?
Was your first reaction “Bullshit, there are always server involved”?
Who has an idea what it is?
Serverless architecture
5
Definition from Mike Roberts:
Serverless architectures are internet based systems where the
application development does not use the usual server process.
Instead they rely solely on a combination of third-party services,
client-side logic, and service hosted remote procedure calls.
https://martinfowler.com/bliki/Serverless.html
Serverless architecture
6
By using 3rd party services and sticking them together, I don’t
care anymore on which server the code is running.
Serverless architecture
7
Big differences to normal pricing models:
• Classic VM hosting pricing model
• X €/Month independent of usage
• Serverless pricing models
• A€ for B number of executions
• C€ for D usage of resources.
Business driven development
8
Export of data into specific format
• Feature that is rarely used
• Needs a lot of resources
Classic:
Separate VM(s) that provide the functionality
• No influence on performance of the remaining application
• If the feature is not used, it costs a lot of money to have the
infrastructure running
Serverless:
• Single Function
Business driven development - Example
9
“… the number of active users increased roughly by 50%, but
our hosting costs dropped slightly less than 50%. Plus, we
replaced what was probably our biggest bottleneck with
something that scales without any effort on our side“
Gojko Adzic
https://gojko.net/2017/02/23/serverless-migration-lesson.html
Business driven development
10
Azure’s part
11
• Microsoft Flow
• Azure Logic Apps
• Azure Automation
• Azure Functions
Azure’s parts for Serverless Architecture
12
Azure Functions
13
Which languages can I use?
• C#
• F#
• JavaScript
• PHP
• Python
• Batch
• PowerShell
• Bash
Most important question first!
14
Through different triggers
• Timer schedule
• HTTP
• REST
• WebHook
• Blob Storage
• EventHub
• Queue Storage
How gets a Function called?
15
• HTTP Requests
• Blobs
• Events
• Queue Entries
• Tables
• Push Notifications
What gets in? What gets out?
16
Bindings serve as the basis for all connections to and from a
function.
Function Bindings
Type Service Trigger Input Output
Schedule Azure Functions ✔
HTTP (REST or webhook) Azure Functions ✔ ✔
Blob Storage Azure Storage ✔ ✔ ✔
Events Azure Event Hubs ✔ ✔
Queues Azure Storage ✔ ✔
Tables Azure Storage ✔ ✔
Tables Azure Mobile Apps ✔ ✔
No-SQL DB Azure DocumentDB ✔ ✔
Push Notifications Azure Notification Hubs ✔
17
• Scaling
• done automatically with magic
• Proxies
• One API surface for multiple function app
Which batteries are included?
18
Demo – Creating a function app
19
• Azure Functions are not State-full or State-less
• Multiple calls could be in same process
• Up- Scaling needs time
• Just because you are having 10 requests at a moment, you
do not get 10 separate processes
• Currently not the best performance
Behavior
20
Execution time:
€0.000014/GB-s (GigaByte Seconds)
1GB used for one second = 1 GB-s
512 MB used for 2 seconds = 1 GB-s
Execution count:
€0.169 per Million Executions
Free:
• 400.000 GB-s
• 1 Million Executions
How much does it cost?
21
Development & Deployment of Azure
Functions
22
• Flow => included in Office 365, some connections costs
• Logic => per Action and App Service Plan
• Automation => minute
Prices
23
Programming in Web Browser ?
What if we develop in teams?
Only one code file ?
Real World Development
24
• Azure Functions CLI
• https://www.npmjs.com/package/azure-functions-cli
• Visual Studio Tools for Azure Functions
• Preview
• Visual Studio 2015 Update 3
• https://aka.ms/FunctionsVsTools
Tools
Demo
26
• Kudu (Azure Copy Deploy)
• Bitbucket
• Dropbox
• Git local repo
• Git external repo
• GitHub
• Mercurial external repo
• OneDrive
• Visual Studio Team Services
Deploy Azure Functions in Team Environment
27
• wwwroot
• | - host.json
• | - FirstFunction
• | | - function.json
• | | - index.js
• | | - node_modules
• | | | - ... packages ...
• | | - package.json
• | - SecondFunction
• | | - function.json
• | | - run.csx
Folder Hierachy for development
Demo
29
Isolated Azure Functions
30
Function app A
/customer
Function app B
/products
Function app C
Function3/orders
Function1
API proxy endpoints
HttpTrigger function endpoints
Key:
/products
/orders
Function2
Azure Functions Proxy
31
{
"proxies": {
"proxy1": {
"matchCondition": {
"methods": [],
"route": "/api/{test}"
},
"backendUri": "https://contoso.azurewebsites.net/api/{test}"
}
}
}
New file on site root: proxies.json
32
• System
• System.Collections.Generic
• System.IO
• System.Linq
• System.Net.Http
• System.Threading.Tasks
• Microsoft.Azure.WebJobs
• Microsoft.Azure.WebJobs.Host.
Automatically imported References
33
• #r "System.Web.Http„
• Package management (NuGet, NPM)
• Copy to Bin Folder
• #load "mylogger.csx"
• #load "..sharedmylogger.csx”
Referencing External Assemblies
34
• Avoid large long running functions
• Cross function communication
• Write functions to be stateless
• Write defensive functions
• Don't mix test and production code in the same function app
• Use async code but avoid Task.Result
Best Practices
35
• Thanks to Mark Heath
Example
36
• Azure Functions Source Code:
• https://github.com/Azure/azure-webjobs-sdk
• https://github.com/Azure/azure-webjobs-sdk-script
• https://github.com/projectkudu/AzureFunctionsPortal
• Visualizer Azure
http://Armviz.io
Links
37
Reading stuff
• https://martinfowler.com/articles/serverless.html
• https://martinfowler.com/bliki/Serverless.html
• https://gojko.net/2016/08/27/serverless.html
• https://gojko.net/2017/02/23/serverless-migration-lesson.html
Thank you!
39
“Migrating to a Serverless Architecture” Training by Gojko Adzic
3-day Training
22-24 March 2017, 9 am to 5 pm
https://techtalk.at/trainings/migrating-to-a-serverless-
architecture/
Commercial break
40

More Related Content

What's hot

What's hot (20)

Azure functions serverless
Azure functions serverlessAzure functions serverless
Azure functions serverless
 
Chris Anderson and Yochay Kiriaty - Serverless Patterns with Azure Functions
Chris Anderson and Yochay Kiriaty - Serverless Patterns with Azure FunctionsChris Anderson and Yochay Kiriaty - Serverless Patterns with Azure Functions
Chris Anderson and Yochay Kiriaty - Serverless Patterns with Azure Functions
 
Serverless computing con Azure Functions
Serverless computing con Azure FunctionsServerless computing con Azure Functions
Serverless computing con Azure Functions
 
Serverless Application Development with Azure
Serverless Application Development with AzureServerless Application Development with Azure
Serverless Application Development with Azure
 
Azure functions
Azure functionsAzure functions
Azure functions
 
WRITE SCALABLE COMMUNICATION APPLICATION WITH POWER OF SERVERLESS
WRITE SCALABLE COMMUNICATION APPLICATION WITH POWER OF SERVERLESSWRITE SCALABLE COMMUNICATION APPLICATION WITH POWER OF SERVERLESS
WRITE SCALABLE COMMUNICATION APPLICATION WITH POWER OF SERVERLESS
 
Building API in the cloud using Azure Functions
Building API in the cloud using Azure FunctionsBuilding API in the cloud using Azure Functions
Building API in the cloud using Azure Functions
 
Azure Functions @ global azure day 2017
Azure Functions  @ global azure day 2017Azure Functions  @ global azure day 2017
Azure Functions @ global azure day 2017
 
Let's Talk About Serverless - Focusing on AWS Lambda
Let's Talk About Serverless - Focusing on AWS LambdaLet's Talk About Serverless - Focusing on AWS Lambda
Let's Talk About Serverless - Focusing on AWS Lambda
 
Vincent biret azure functions and flow (ottawa)
Vincent biret azure functions and flow (ottawa)Vincent biret azure functions and flow (ottawa)
Vincent biret azure functions and flow (ottawa)
 
Vincent biret azure functions and flow (toronto)
Vincent biret azure functions and flow (toronto)Vincent biret azure functions and flow (toronto)
Vincent biret azure functions and flow (toronto)
 
Serverless in azure
Serverless in azureServerless in azure
Serverless in azure
 
O365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio StruyfO365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
 
Azure Functions - Introduction
Azure Functions - IntroductionAzure Functions - Introduction
Azure Functions - Introduction
 
SPS calgary 2017 introduction to azure functions microsoft flow
SPS calgary 2017 introduction to azure functions microsoft flowSPS calgary 2017 introduction to azure functions microsoft flow
SPS calgary 2017 introduction to azure functions microsoft flow
 
Azure Web Apps Advanced Security
Azure Web Apps Advanced SecurityAzure Web Apps Advanced Security
Azure Web Apps Advanced Security
 
Introduction to serverless compute with azure functions
Introduction to serverless compute with azure functionsIntroduction to serverless compute with azure functions
Introduction to serverless compute with azure functions
 
AWS Lambda Containers - bridging the gap between serverless and containers on...
AWS Lambda Containers - bridging the gap between serverless and containers on...AWS Lambda Containers - bridging the gap between serverless and containers on...
AWS Lambda Containers - bridging the gap between serverless and containers on...
 
Rob Gruhl and Erik Erikson - What We Learned in 18 Serverless Months at Nords...
Rob Gruhl and Erik Erikson - What We Learned in 18 Serverless Months at Nords...Rob Gruhl and Erik Erikson - What We Learned in 18 Serverless Months at Nords...
Rob Gruhl and Erik Erikson - What We Learned in 18 Serverless Months at Nords...
 
Azure Web Apps - Introduction
Azure Web Apps - IntroductionAzure Web Apps - Introduction
Azure Web Apps - Introduction
 

Viewers also liked

Тепловые явления
Тепловые явленияТепловые явления
Тепловые явления
sveta7940
 
Тепловые явления
Тепловые явленияТепловые явления
Тепловые явления
sveta7940
 

Viewers also liked (20)

Building serverless apps with Node.js
Building serverless apps with Node.jsBuilding serverless apps with Node.js
Building serverless apps with Node.js
 
Serverless Architectures and Continuous Delivery
Serverless Architectures and Continuous DeliveryServerless Architectures and Continuous Delivery
Serverless Architectures and Continuous Delivery
 
Azure Functions
Azure FunctionsAzure Functions
Azure Functions
 
Serverles com Azure Functions & DocumentDB
Serverles com Azure Functions & DocumentDBServerles com Azure Functions & DocumentDB
Serverles com Azure Functions & DocumentDB
 
Serverless Architecture - Azure Logic apps
Serverless Architecture - Azure Logic appsServerless Architecture - Azure Logic apps
Serverless Architecture - Azure Logic apps
 
Serverless - When to FaaS?
Serverless - When to FaaS?Serverless - When to FaaS?
Serverless - When to FaaS?
 
Serverless
ServerlessServerless
Serverless
 
Serverless Azure
Serverless AzureServerless Azure
Serverless Azure
 
Serverless / FaaS / Lambda and how it relates to Microservices
Serverless / FaaS / Lambda and how it relates to MicroservicesServerless / FaaS / Lambda and how it relates to Microservices
Serverless / FaaS / Lambda and how it relates to Microservices
 
Aqueous Two Phase Extraction
Aqueous Two Phase Extraction Aqueous Two Phase Extraction
Aqueous Two Phase Extraction
 
Empezando el Negocio de Aceites Esenciales
Empezando el Negocio de Aceites EsencialesEmpezando el Negocio de Aceites Esenciales
Empezando el Negocio de Aceites Esenciales
 
Тепловые явления
Тепловые явленияТепловые явления
Тепловые явления
 
Beat box daniel peña
Beat box daniel peñaBeat box daniel peña
Beat box daniel peña
 
Snowmageddon 2017 at Aptos
Snowmageddon 2017 at AptosSnowmageddon 2017 at Aptos
Snowmageddon 2017 at Aptos
 
Oakai labs-pitchdeck
Oakai labs-pitchdeckOakai labs-pitchdeck
Oakai labs-pitchdeck
 
Тепловые явления
Тепловые явленияТепловые явления
Тепловые явления
 
Organising
OrganisingOrganising
Organising
 
Microsoft Azure vs Amazon Web Services (AWS) Services & Feature Mapping
Microsoft Azure vs Amazon Web Services (AWS) Services & Feature MappingMicrosoft Azure vs Amazon Web Services (AWS) Services & Feature Mapping
Microsoft Azure vs Amazon Web Services (AWS) Services & Feature Mapping
 
Docker from A to Z, including Swarm and OCCS
Docker from A to Z, including Swarm and OCCSDocker from A to Z, including Swarm and OCCS
Docker from A to Z, including Swarm and OCCS
 
Azure - The Good Parts
Azure - The Good PartsAzure - The Good Parts
Azure - The Good Parts
 

Similar to Serverless with Azure Functions

Similar to Serverless with Azure Functions (20)

From Zero to Serverless
From Zero to ServerlessFrom Zero to Serverless
From Zero to Serverless
 
Introduction to Azure Functions
Introduction to Azure FunctionsIntroduction to Azure Functions
Introduction to Azure Functions
 
Azure functions: Build apps faster with serverless architecture (March 2018)
Azure functions: Build apps faster with serverless architecture (March 2018)Azure functions: Build apps faster with serverless architecture (March 2018)
Azure functions: Build apps faster with serverless architecture (March 2018)
 
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
 
Web jobs, Azure Functions and Serverless Computing
Web jobs, Azure Functions and Serverless ComputingWeb jobs, Azure Functions and Serverless Computing
Web jobs, Azure Functions and Serverless Computing
 
Azure serverless computing
Azure serverless computingAzure serverless computing
Azure serverless computing
 
Architecture Battle: PaaS vs. FaaS
Architecture Battle: PaaS vs. FaaSArchitecture Battle: PaaS vs. FaaS
Architecture Battle: PaaS vs. FaaS
 
Microservices and Serverless for Mega Startups - DevOps IL Meetup
Microservices and Serverless for Mega Startups - DevOps IL MeetupMicroservices and Serverless for Mega Startups - DevOps IL Meetup
Microservices and Serverless for Mega Startups - DevOps IL Meetup
 
Azure Functions 101
Azure Functions 101Azure Functions 101
Azure Functions 101
 
Serverless integrations using Azure Logic Apps (intro)
Serverless integrations using Azure Logic Apps (intro)Serverless integrations using Azure Logic Apps (intro)
Serverless integrations using Azure Logic Apps (intro)
 
Mobile Services for Windows Azure
Mobile Services for Windows AzureMobile Services for Windows Azure
Mobile Services for Windows Azure
 
From Zero to Serverless (DogFoodCon 2018)
From Zero to Serverless (DogFoodCon 2018)From Zero to Serverless (DogFoodCon 2018)
From Zero to Serverless (DogFoodCon 2018)
 
From Zero to Serverless (CoderCruise 2018)
From Zero to Serverless (CoderCruise 2018)From Zero to Serverless (CoderCruise 2018)
From Zero to Serverless (CoderCruise 2018)
 
Azure functions - Build apps faster with serverless architecture
Azure functions - Build apps faster with serverless architectureAzure functions - Build apps faster with serverless architecture
Azure functions - Build apps faster with serverless architecture
 
SRV312 DevOps on AWS: Building Systems to Deliver Faster
SRV312 DevOps on AWS: Building Systems to Deliver FasterSRV312 DevOps on AWS: Building Systems to Deliver Faster
SRV312 DevOps on AWS: Building Systems to Deliver Faster
 
Serverless brewbox
Serverless   brewboxServerless   brewbox
Serverless brewbox
 
Developer Tools at AWS 2018.pdf
Developer Tools at AWS 2018.pdfDeveloper Tools at AWS 2018.pdf
Developer Tools at AWS 2018.pdf
 
Azure app service to create web and mobile apps
Azure app service to create web and mobile appsAzure app service to create web and mobile apps
Azure app service to create web and mobile apps
 
Serverless Node.js
Serverless Node.jsServerless Node.js
Serverless Node.js
 
DevOps on AWS: DevOps Day San Francisco
DevOps on AWS: DevOps Day San FranciscoDevOps on AWS: DevOps Day San Francisco
DevOps on AWS: DevOps Day San Francisco
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
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
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
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
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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
 

Serverless with Azure Functions

  • 2. 2 What is a serverless architecture? What is serverless on Azure? What are Azure Functions? What can they do? How do I develop Azure Functions? How the heck can I deploy the stuff? Questions to be answered
  • 4. 4 Who heard about it? Was your first reaction “Bullshit, there are always server involved”? Who has an idea what it is? Serverless architecture
  • 5. 5 Definition from Mike Roberts: Serverless architectures are internet based systems where the application development does not use the usual server process. Instead they rely solely on a combination of third-party services, client-side logic, and service hosted remote procedure calls. https://martinfowler.com/bliki/Serverless.html Serverless architecture
  • 6. 6 By using 3rd party services and sticking them together, I don’t care anymore on which server the code is running. Serverless architecture
  • 7. 7 Big differences to normal pricing models: • Classic VM hosting pricing model • X €/Month independent of usage • Serverless pricing models • A€ for B number of executions • C€ for D usage of resources. Business driven development
  • 8. 8 Export of data into specific format • Feature that is rarely used • Needs a lot of resources Classic: Separate VM(s) that provide the functionality • No influence on performance of the remaining application • If the feature is not used, it costs a lot of money to have the infrastructure running Serverless: • Single Function Business driven development - Example
  • 9. 9 “… the number of active users increased roughly by 50%, but our hosting costs dropped slightly less than 50%. Plus, we replaced what was probably our biggest bottleneck with something that scales without any effort on our side“ Gojko Adzic https://gojko.net/2017/02/23/serverless-migration-lesson.html Business driven development
  • 11. 11 • Microsoft Flow • Azure Logic Apps • Azure Automation • Azure Functions Azure’s parts for Serverless Architecture
  • 13. 13 Which languages can I use? • C# • F# • JavaScript • PHP • Python • Batch • PowerShell • Bash Most important question first!
  • 14. 14 Through different triggers • Timer schedule • HTTP • REST • WebHook • Blob Storage • EventHub • Queue Storage How gets a Function called?
  • 15. 15 • HTTP Requests • Blobs • Events • Queue Entries • Tables • Push Notifications What gets in? What gets out?
  • 16. 16 Bindings serve as the basis for all connections to and from a function. Function Bindings Type Service Trigger Input Output Schedule Azure Functions ✔ HTTP (REST or webhook) Azure Functions ✔ ✔ Blob Storage Azure Storage ✔ ✔ ✔ Events Azure Event Hubs ✔ ✔ Queues Azure Storage ✔ ✔ Tables Azure Storage ✔ ✔ Tables Azure Mobile Apps ✔ ✔ No-SQL DB Azure DocumentDB ✔ ✔ Push Notifications Azure Notification Hubs ✔
  • 17. 17 • Scaling • done automatically with magic • Proxies • One API surface for multiple function app Which batteries are included?
  • 18. 18 Demo – Creating a function app
  • 19. 19 • Azure Functions are not State-full or State-less • Multiple calls could be in same process • Up- Scaling needs time • Just because you are having 10 requests at a moment, you do not get 10 separate processes • Currently not the best performance Behavior
  • 20. 20 Execution time: €0.000014/GB-s (GigaByte Seconds) 1GB used for one second = 1 GB-s 512 MB used for 2 seconds = 1 GB-s Execution count: €0.169 per Million Executions Free: • 400.000 GB-s • 1 Million Executions How much does it cost?
  • 21. 21 Development & Deployment of Azure Functions
  • 22. 22 • Flow => included in Office 365, some connections costs • Logic => per Action and App Service Plan • Automation => minute Prices
  • 23. 23 Programming in Web Browser ? What if we develop in teams? Only one code file ? Real World Development
  • 24. 24 • Azure Functions CLI • https://www.npmjs.com/package/azure-functions-cli • Visual Studio Tools for Azure Functions • Preview • Visual Studio 2015 Update 3 • https://aka.ms/FunctionsVsTools Tools
  • 25. Demo
  • 26. 26 • Kudu (Azure Copy Deploy) • Bitbucket • Dropbox • Git local repo • Git external repo • GitHub • Mercurial external repo • OneDrive • Visual Studio Team Services Deploy Azure Functions in Team Environment
  • 27. 27 • wwwroot • | - host.json • | - FirstFunction • | | - function.json • | | - index.js • | | - node_modules • | | | - ... packages ... • | | - package.json • | - SecondFunction • | | - function.json • | | - run.csx Folder Hierachy for development
  • 28. Demo
  • 30. 30 Function app A /customer Function app B /products Function app C Function3/orders Function1 API proxy endpoints HttpTrigger function endpoints Key: /products /orders Function2 Azure Functions Proxy
  • 31. 31 { "proxies": { "proxy1": { "matchCondition": { "methods": [], "route": "/api/{test}" }, "backendUri": "https://contoso.azurewebsites.net/api/{test}" } } } New file on site root: proxies.json
  • 32. 32 • System • System.Collections.Generic • System.IO • System.Linq • System.Net.Http • System.Threading.Tasks • Microsoft.Azure.WebJobs • Microsoft.Azure.WebJobs.Host. Automatically imported References
  • 33. 33 • #r "System.Web.Http„ • Package management (NuGet, NPM) • Copy to Bin Folder • #load "mylogger.csx" • #load "..sharedmylogger.csx” Referencing External Assemblies
  • 34. 34 • Avoid large long running functions • Cross function communication • Write functions to be stateless • Write defensive functions • Don't mix test and production code in the same function app • Use async code but avoid Task.Result Best Practices
  • 35. 35 • Thanks to Mark Heath Example
  • 36. 36 • Azure Functions Source Code: • https://github.com/Azure/azure-webjobs-sdk • https://github.com/Azure/azure-webjobs-sdk-script • https://github.com/projectkudu/AzureFunctionsPortal • Visualizer Azure http://Armviz.io Links
  • 37. 37 Reading stuff • https://martinfowler.com/articles/serverless.html • https://martinfowler.com/bliki/Serverless.html • https://gojko.net/2016/08/27/serverless.html • https://gojko.net/2017/02/23/serverless-migration-lesson.html
  • 39. 39 “Migrating to a Serverless Architecture” Training by Gojko Adzic 3-day Training 22-24 March 2017, 9 am to 5 pm https://techtalk.at/trainings/migrating-to-a-serverless- architecture/ Commercial break
  • 40. 40

Editor's Notes

  1. Without bindings, an Azure Function would just be a “disconnected” algorithm without any way to serve a purpose. Bindings server to connect functions and output to other services. Some of the most common binding types and features are listed in the table, however variations and adaptations can and do exist.
  2. Avoid large long running functions unexpected timeout issues many Node.js dependencies refactor large functions into smaller function Cross function communication use storage queues Write functions to be stateless Also if a previous run failed to complete, the next run should pick up where it left off. Write defensive functions continue from a previous fail Don't mix test and production code in the same function app Functions within a function app share resources. Use async code but avoid Task.Result Holding a lock creates the potential for deadlocks.