SlideShare a Scribd company logo
#PitchOnline presents:
#PitchOnline presents:
Massimo Bonanni
Paranormal Trainer, with the head in the Cloud and all the REST in microservices!
massimo.bonanni@microsoft.com
@massimobonanni
Scifoni Ivano Fabio Mannis Francesco Del Re Matteo Riccardi Valerio Benedetti
The art of Azure Functions (unit) testing and monitoring!
The issue….
If you want to use Azure
Functions as components
of your Enterprise
solutions, you must test
and monitor them!!!
What are Azure Functions
Author functions in
C#, F#, Node.JS, Java,
Powershell, and more
Code
Events
React to timers, HTTP
, or
events from your favorite
Azure services, with more
on the way
Outputs
Send results to an
ever-growing collection
of services
The art of Azure Functions (unit) testing and monitoring!
What is a Unit Test
In a unit test you invoke a piece of your code with a
set of parameters and you checks the correctness its
behavior.
In a unit test you must substitute all your external
reference with a mock or stub.
Mock is for the software what a dummy is for a car
crash test (you don’t test a car with a human being
inside…I Hope!!)
The art of Azure Functions (unit) testing and monitoring!
Azure Functions Dependencies
You should implement your Azure Functions to allow you to
use mock/stub for all external reference!
Your
Function
Trigger
Binding
Binding
Binding
Binding
Your Service
Your Service
Your Service
Your Service
Logger
(infrastructure)
The art of Azure Functions (unit) testing and monitoring!
Azure Function … untestable!!
The art of Azure Functions (unit) testing and monitoring!
Azure Function … trigger!!
Trigger
You can mock it
because the trigger
payload is a POCO
class
The art of Azure Functions (unit) testing and monitoring!
Azure Function … bindings!!
Binding
You can mock it because
the binding payload is
an interface
The art of Azure Functions (unit) testing and monitoring!
Azure Function … logger!!
Logger
(infrastructural objects)
You can mock it because
the logger is an interface
The art of Azure Functions (unit) testing and monitoring!
Azure Function … your service!!
External service
You cannot substitute it
with your mock because it
is created inside the Azure
Function and you haven’t a
way to substitute it
The art of Azure Functions (unit) testing and monitoring!
Make your Azure Function testable!!!
The solution of your problem is: Dependency Injection !!
Azure Functions Runtime is based on .NET Core.
Azure Functions support the same ASP.NET Core
Dependency Injection!!!
Using Dependency Injection you provide a way to substitute
your Services with a mock!
The art of Azure Functions (unit) testing and monitoring!
Azure Function … testable!!
Constructor Injection
You can choose what kind of
actual service you want to use
when you instantiate the
function.
In a test you can substitute it
with a mock!!
The art of Azure Functions (unit) testing and monitoring!
Azure Function … how to use mock!!
Mock
Create a mock to use in the
test!!
The art of Azure Functions (unit) testing and monitoring!
DEMO
Azure Functions
Unit Testing
The art of Azure Functions (unit) testing and monitoring!
Monitoring Azure Functions
Once you deploy your Azure Functions on Azure, you need to monitor them to check when something
goes wrong.
The signature of an Azure Function Run method provides the instance of ILogger that you can use to log
information about your code.
Using ILogger, you can collect information from your code execution to monitor and triage errors and
exceptions.
The art of Azure Functions (unit) testing and monitoring!
Azure Functions Monitor
Azure Functions provide out-of-the-box monitor feature.
For each Function, you can have info about every function execution.
The art of Azure Functions (unit) testing and monitoring!
Azure Functions and Application Insight
The Azure Functions platform offers built-in integration with Azure
Application Insights.
Put the Application Insights instrumentation key in the function app
settings.
The art of Azure Functions (unit) testing and monitoring!
Configure monitoring
Logging is configured in host.json file.
Logger default level
Logger level for all the functions in
Function App
Logger level for a specific function
in Function App
Logger category for .NET runtime
components invoked by the host
The art of Azure Functions (unit) testing and monitoring!
Custom Metrics
Azure Function SDK
provides you extension
methods to log custom
metrics.
The art of Azure Functions (unit) testing and monitoring!
Pricing
Azure Functions consumption plan is billed based on per-second
resource consumption and executions
The art of Azure Functions (unit) testing and monitoring!
Pricing
Azure Functions consumption plan is billed based on per-second
resource consumption and executions
If your function use 1GB of
memory and its duration is 1
second, you pay €0.000014
each time the function runs.
The art of Azure Functions (unit) testing and monitoring!
Pricing
Azure Functions consumption plan is billed based on per-second
resource consumption and executions If your function runs 1 million
times every month, you pay
€0.169 each month.
The art of Azure Functions (unit) testing and monitoring!
Pricing - Example
You have a function:
• It runs every second
• Its duration is 1 second
• It uses 512 MB of memory
The art of Azure Functions (unit) testing and monitoring!
Resource Consumption Billing Calculation
• It runs every second
• Its duration is 1 second
• It uses 512 MB of memory
Executions 2,592,000
Resource Consumption Total 2,592,000 x 1 sec = 2,592,000 sec
Total GB-s 2,592,000 x 0.5 GB = 1,296,000 GB-s
Total billable consumption 1,296,000 – 400,000 = 896,000 GB-s
Total cost 896,000 x 0.000014€ = 12.54 €
The art of Azure Functions (unit) testing and monitoring!
Executions billing calculation
• It runs every second
• Its duration is 1 second
• It uses 512 MB of memory
Billable Monthly Executions 2,592,000 – 1,000,000 = 1,592,000
Total cost 1.592 x 0.169 € = 0.269 €
The art of Azure Functions (unit) testing and monitoring!
Total Monthly Cost
• It runs every second
• Its duration is 1 second
• It uses 512 MB of memory
Monthly resource consumption cost 12.540 €
Monthly executions cost 0.269 €
Total monthly cost 12.809 €
The art of Azure Functions (unit) testing and monitoring!
DEMO
Azure Functions
Monitoring
The art of Azure Functions (unit) testing and monitoring!
Takeaway
Write an Azure Functions is simple!
Testing Azure Functions is simple!
Monitoring Azure Functions is simple!
…. then ….
Photo by Aaron Burden on Unsplash
The art of Azure Functions (unit) testing and monitoring
Massimo Bonanni
Azure Technical Trainer @ Microsoft
massimo.bonanni@microsoft.com
@massimobonanni
Connect with me on LinkedIn
linkedin.com/in/massimobonanni/
http://bit.ly/MasteringServerless
References
Azure Functions Documentation
https://docs.microsoft.com/en-US/azure/azure-functions/
Azure Functions Code Samples
https://azure.microsoft.com/en-us/resources/samples/?service=functions&sort=0
Azure Updates
https://azure.microsoft.com/en-us/roadmap/?category=compute
Azure Friday – Build Serverless APIs with Azure Functions
https://azure.microsoft.com/en-us/resources/videos/azure-friday-build-serverless-apis-with-azure-functions/
GitHub Demo
https://github.com/massimobonanni/AzureFunctionsSamples
The art of Azure Functions (unit) testing and monitoring!
Thank You!
Our Socials

More Related Content

What's hot (20)

PPT
Servicehost Customization
Eyal Vardi
 
PPTX
Testing a Service Fabric solution and live happy!!
Massimo Bonanni
 
PDF
Xmas Serverless Transformation: when the elf doesn’t scale!
Massimo Bonanni
 
PPTX
Introducing to Azure Functions
Jorge Jeffrey Vargas Ipince
 
PPTX
Discovering the Service Fabric's actor model
Massimo Bonanni
 
PPT
Linq
tnkreddy
 
PDF
Azure functions
Rajesh Kolla
 
PPTX
Windows iot barone
DotNetCampus
 
PPTX
Discovering the Service Fabric's actor model
Massimo Bonanni
 
PPTX
Grails with swagger
NexThoughts Technologies
 
PDF
Integrating consumers IoT devices into Business Workflow
Yakov Fain
 
PDF
Angular 4 for Java Developers
Yakov Fain
 
PDF
Reactive Thinking in Java with RxJava2
Yakov Fain
 
PDF
Angular2 Development for Java developers
Yakov Fain
 
PDF
Intro to JavaScript
Yakov Fain
 
PDF
Building a Lightning App with Angular Material Design
Salesforce Developers
 
PPT
Asp.Net Ajax Component Development
Chui-Wen Chiu
 
PDF
Advanced Spring Boot with Consul
VMware Tanzu
 
PPTX
Deep dive into azure durable functions
Ahmed Elharouny
 
PPTX
Phonegap android angualr material design
Srinadh Kanugala
 
Servicehost Customization
Eyal Vardi
 
Testing a Service Fabric solution and live happy!!
Massimo Bonanni
 
Xmas Serverless Transformation: when the elf doesn’t scale!
Massimo Bonanni
 
Introducing to Azure Functions
Jorge Jeffrey Vargas Ipince
 
Discovering the Service Fabric's actor model
Massimo Bonanni
 
Linq
tnkreddy
 
Azure functions
Rajesh Kolla
 
Windows iot barone
DotNetCampus
 
Discovering the Service Fabric's actor model
Massimo Bonanni
 
Grails with swagger
NexThoughts Technologies
 
Integrating consumers IoT devices into Business Workflow
Yakov Fain
 
Angular 4 for Java Developers
Yakov Fain
 
Reactive Thinking in Java with RxJava2
Yakov Fain
 
Angular2 Development for Java developers
Yakov Fain
 
Intro to JavaScript
Yakov Fain
 
Building a Lightning App with Angular Material Design
Salesforce Developers
 
Asp.Net Ajax Component Development
Chui-Wen Chiu
 
Advanced Spring Boot with Consul
VMware Tanzu
 
Deep dive into azure durable functions
Ahmed Elharouny
 
Phonegap android angualr material design
Srinadh Kanugala
 

Similar to The art of Azure Functions (unit) testing and monitoring (20)

PPTX
Azure Functions - Introduction
Venkatesh Narayanan
 
PDF
Serverless Computing with Azure
Analben Mehta
 
PPTX
Azure Functions.pptx
YachikaKamra
 
PDF
Serverless API with Azure Functions
Analben Mehta
 
PDF
Getting Started with Serverless Architectures using Azure Functions
Marc Duiker
 
PPTX
slides.pptx
abcabc794064
 
PPTX
Durable functions
Amresh Krishnamurthy
 
PPTX
Save Azure Cost
Karthikeyan VK
 
PDF
Massimo Bonanni - Workflow as code with Azure Durable Functions - Codemotion ...
Codemotion
 
PPTX
Serverless Development with Azure Durable Functions in .Net by Jonah Andersson
Jonah Andersson
 
PPTX
Guidelines to understand durable functions with .net core, c# and stateful se...
Concetto Labs
 
PPTX
Serverless on Azure with Functions
Christos Matskas
 
PPTX
SharePoint meetup Speaking Deck - Knowing the formula
Kenneth Cooper
 
PPTX
Building stateful serverless orchestrations with Azure Durable Azure Function...
Callon Campbell
 
PPTX
Anti Patterns and Mistakes Using Serverless (ServerlessConf SF - 08 2018)
Yochay Kiriaty
 
PPTX
Durable Azure Functions
Pushkar Saraf
 
PDF
Workflow as code with Azure Durable Functions
Massimo Bonanni
 
PPTX
Building API in the cloud using Azure Functions
Aleksandar Bozinovski
 
PDF
Building scalable applications with angular js
Andrew Alpert
 
PPTX
Mastering Azure Durable Functions - Building Resilient and Scalable Workflows
Callon Campbell
 
Azure Functions - Introduction
Venkatesh Narayanan
 
Serverless Computing with Azure
Analben Mehta
 
Azure Functions.pptx
YachikaKamra
 
Serverless API with Azure Functions
Analben Mehta
 
Getting Started with Serverless Architectures using Azure Functions
Marc Duiker
 
slides.pptx
abcabc794064
 
Durable functions
Amresh Krishnamurthy
 
Save Azure Cost
Karthikeyan VK
 
Massimo Bonanni - Workflow as code with Azure Durable Functions - Codemotion ...
Codemotion
 
Serverless Development with Azure Durable Functions in .Net by Jonah Andersson
Jonah Andersson
 
Guidelines to understand durable functions with .net core, c# and stateful se...
Concetto Labs
 
Serverless on Azure with Functions
Christos Matskas
 
SharePoint meetup Speaking Deck - Knowing the formula
Kenneth Cooper
 
Building stateful serverless orchestrations with Azure Durable Azure Function...
Callon Campbell
 
Anti Patterns and Mistakes Using Serverless (ServerlessConf SF - 08 2018)
Yochay Kiriaty
 
Durable Azure Functions
Pushkar Saraf
 
Workflow as code with Azure Durable Functions
Massimo Bonanni
 
Building API in the cloud using Azure Functions
Aleksandar Bozinovski
 
Building scalable applications with angular js
Andrew Alpert
 
Mastering Azure Durable Functions - Building Resilient and Scalable Workflows
Callon Campbell
 
Ad

More from Massimo Bonanni (17)

PDF
Architetture Serverless con SQL Server e Azure Functions
Massimo Bonanni
 
PDF
Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...
Massimo Bonanni
 
PDF
Everything you always wanted to know about API Management (but were afraid to...
Massimo Bonanni
 
PPTX
Welcome Azure Functions 2. 0
Massimo Bonanni
 
PPTX
Soluzioni IoT con le tecnologie Microsoft
Massimo Bonanni
 
PPTX
Project Gesture & Real Sense: il potere nelle mani!!
Massimo Bonanni
 
PPTX
Project Gesture & RealSense: gestures in a simple way!!
Massimo Bonanni
 
PPTX
Project Prague & RealSense: il potere nelle mani!!
Massimo Bonanni
 
PPTX
L'approccio ai microservizi secondo Service Fabric
Massimo Bonanni
 
PPTX
The Microservices world in. NET Core and. NET framework
Massimo Bonanni
 
PPTX
Microservices architecture & Service Fabric
Massimo Bonanni
 
PPTX
Introduzione allo sviluppo UWP per xBox
Massimo Bonanni
 
PPTX
Cognitive Services & LUIS
Massimo Bonanni
 
PPTX
Service Fabric: la potenza dei micro servizi
Massimo Bonanni
 
PPTX
Automated UI testing for iOs and Android mobile apps
Massimo Bonanni
 
PPTX
Soluzioni IoT con le tecnologie Microsoft
Massimo Bonanni
 
PPTX
Xamarin Test Cloud
Massimo Bonanni
 
Architetture Serverless con SQL Server e Azure Functions
Massimo Bonanni
 
Tutto quello che avreste voluto sapere sull'API Management (e non avete mai o...
Massimo Bonanni
 
Everything you always wanted to know about API Management (but were afraid to...
Massimo Bonanni
 
Welcome Azure Functions 2. 0
Massimo Bonanni
 
Soluzioni IoT con le tecnologie Microsoft
Massimo Bonanni
 
Project Gesture & Real Sense: il potere nelle mani!!
Massimo Bonanni
 
Project Gesture & RealSense: gestures in a simple way!!
Massimo Bonanni
 
Project Prague & RealSense: il potere nelle mani!!
Massimo Bonanni
 
L'approccio ai microservizi secondo Service Fabric
Massimo Bonanni
 
The Microservices world in. NET Core and. NET framework
Massimo Bonanni
 
Microservices architecture & Service Fabric
Massimo Bonanni
 
Introduzione allo sviluppo UWP per xBox
Massimo Bonanni
 
Cognitive Services & LUIS
Massimo Bonanni
 
Service Fabric: la potenza dei micro servizi
Massimo Bonanni
 
Automated UI testing for iOs and Android mobile apps
Massimo Bonanni
 
Soluzioni IoT con le tecnologie Microsoft
Massimo Bonanni
 
Xamarin Test Cloud
Massimo Bonanni
 
Ad

Recently uploaded (20)

PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Python basic programing language for automation
DanialHabibi2
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
July Patch Tuesday
Ivanti
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Python basic programing language for automation
DanialHabibi2
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Windsurf Meetup Ottawa 2025-07-12 - Planning Mode at Reliza.pdf
Pavel Shukhman
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
July Patch Tuesday
Ivanti
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 

The art of Azure Functions (unit) testing and monitoring

  • 1. #PitchOnline presents: #PitchOnline presents: Massimo Bonanni Paranormal Trainer, with the head in the Cloud and all the REST in microservices! [email protected] @massimobonanni
  • 2. Scifoni Ivano Fabio Mannis Francesco Del Re Matteo Riccardi Valerio Benedetti The art of Azure Functions (unit) testing and monitoring!
  • 3. The issue…. If you want to use Azure Functions as components of your Enterprise solutions, you must test and monitor them!!!
  • 4. What are Azure Functions Author functions in C#, F#, Node.JS, Java, Powershell, and more Code Events React to timers, HTTP , or events from your favorite Azure services, with more on the way Outputs Send results to an ever-growing collection of services The art of Azure Functions (unit) testing and monitoring!
  • 5. What is a Unit Test In a unit test you invoke a piece of your code with a set of parameters and you checks the correctness its behavior. In a unit test you must substitute all your external reference with a mock or stub. Mock is for the software what a dummy is for a car crash test (you don’t test a car with a human being inside…I Hope!!) The art of Azure Functions (unit) testing and monitoring!
  • 6. Azure Functions Dependencies You should implement your Azure Functions to allow you to use mock/stub for all external reference! Your Function Trigger Binding Binding Binding Binding Your Service Your Service Your Service Your Service Logger (infrastructure) The art of Azure Functions (unit) testing and monitoring!
  • 7. Azure Function … untestable!! The art of Azure Functions (unit) testing and monitoring!
  • 8. Azure Function … trigger!! Trigger You can mock it because the trigger payload is a POCO class The art of Azure Functions (unit) testing and monitoring!
  • 9. Azure Function … bindings!! Binding You can mock it because the binding payload is an interface The art of Azure Functions (unit) testing and monitoring!
  • 10. Azure Function … logger!! Logger (infrastructural objects) You can mock it because the logger is an interface The art of Azure Functions (unit) testing and monitoring!
  • 11. Azure Function … your service!! External service You cannot substitute it with your mock because it is created inside the Azure Function and you haven’t a way to substitute it The art of Azure Functions (unit) testing and monitoring!
  • 12. Make your Azure Function testable!!! The solution of your problem is: Dependency Injection !! Azure Functions Runtime is based on .NET Core. Azure Functions support the same ASP.NET Core Dependency Injection!!! Using Dependency Injection you provide a way to substitute your Services with a mock! The art of Azure Functions (unit) testing and monitoring!
  • 13. Azure Function … testable!! Constructor Injection You can choose what kind of actual service you want to use when you instantiate the function. In a test you can substitute it with a mock!! The art of Azure Functions (unit) testing and monitoring!
  • 14. Azure Function … how to use mock!! Mock Create a mock to use in the test!! The art of Azure Functions (unit) testing and monitoring!
  • 15. DEMO Azure Functions Unit Testing The art of Azure Functions (unit) testing and monitoring!
  • 16. Monitoring Azure Functions Once you deploy your Azure Functions on Azure, you need to monitor them to check when something goes wrong. The signature of an Azure Function Run method provides the instance of ILogger that you can use to log information about your code. Using ILogger, you can collect information from your code execution to monitor and triage errors and exceptions. The art of Azure Functions (unit) testing and monitoring!
  • 17. Azure Functions Monitor Azure Functions provide out-of-the-box monitor feature. For each Function, you can have info about every function execution. The art of Azure Functions (unit) testing and monitoring!
  • 18. Azure Functions and Application Insight The Azure Functions platform offers built-in integration with Azure Application Insights. Put the Application Insights instrumentation key in the function app settings. The art of Azure Functions (unit) testing and monitoring!
  • 19. Configure monitoring Logging is configured in host.json file. Logger default level Logger level for all the functions in Function App Logger level for a specific function in Function App Logger category for .NET runtime components invoked by the host The art of Azure Functions (unit) testing and monitoring!
  • 20. Custom Metrics Azure Function SDK provides you extension methods to log custom metrics. The art of Azure Functions (unit) testing and monitoring!
  • 21. Pricing Azure Functions consumption plan is billed based on per-second resource consumption and executions The art of Azure Functions (unit) testing and monitoring!
  • 22. Pricing Azure Functions consumption plan is billed based on per-second resource consumption and executions If your function use 1GB of memory and its duration is 1 second, you pay €0.000014 each time the function runs. The art of Azure Functions (unit) testing and monitoring!
  • 23. Pricing Azure Functions consumption plan is billed based on per-second resource consumption and executions If your function runs 1 million times every month, you pay €0.169 each month. The art of Azure Functions (unit) testing and monitoring!
  • 24. Pricing - Example You have a function: • It runs every second • Its duration is 1 second • It uses 512 MB of memory The art of Azure Functions (unit) testing and monitoring!
  • 25. Resource Consumption Billing Calculation • It runs every second • Its duration is 1 second • It uses 512 MB of memory Executions 2,592,000 Resource Consumption Total 2,592,000 x 1 sec = 2,592,000 sec Total GB-s 2,592,000 x 0.5 GB = 1,296,000 GB-s Total billable consumption 1,296,000 – 400,000 = 896,000 GB-s Total cost 896,000 x 0.000014€ = 12.54 € The art of Azure Functions (unit) testing and monitoring!
  • 26. Executions billing calculation • It runs every second • Its duration is 1 second • It uses 512 MB of memory Billable Monthly Executions 2,592,000 – 1,000,000 = 1,592,000 Total cost 1.592 x 0.169 € = 0.269 € The art of Azure Functions (unit) testing and monitoring!
  • 27. Total Monthly Cost • It runs every second • Its duration is 1 second • It uses 512 MB of memory Monthly resource consumption cost 12.540 € Monthly executions cost 0.269 € Total monthly cost 12.809 € The art of Azure Functions (unit) testing and monitoring!
  • 28. DEMO Azure Functions Monitoring The art of Azure Functions (unit) testing and monitoring!
  • 29. Takeaway Write an Azure Functions is simple! Testing Azure Functions is simple! Monitoring Azure Functions is simple! …. then …. Photo by Aaron Burden on Unsplash
  • 31. Massimo Bonanni Azure Technical Trainer @ Microsoft [email protected] @massimobonanni Connect with me on LinkedIn linkedin.com/in/massimobonanni/ http://bit.ly/MasteringServerless
  • 32. References Azure Functions Documentation https://docs.microsoft.com/en-US/azure/azure-functions/ Azure Functions Code Samples https://azure.microsoft.com/en-us/resources/samples/?service=functions&sort=0 Azure Updates https://azure.microsoft.com/en-us/roadmap/?category=compute Azure Friday – Build Serverless APIs with Azure Functions https://azure.microsoft.com/en-us/resources/videos/azure-friday-build-serverless-apis-with-azure-functions/ GitHub Demo https://github.com/massimobonanni/AzureFunctionsSamples The art of Azure Functions (unit) testing and monitoring!