SlideShare a Scribd company logo
1 of 32
Building stateful serverless orchestrations
with Azure Durable Functions
Callon Campbell
Microsoft MVP | Azure
@flying_maverick
About me
Callon Campbell
Azure Architect | Developer
Adastra
Microsoft MVP | Azure
 20 years enterprise development with Microsoft technologies – .NET (C#),
Azure, ASP.NET, Desktop, SQL, and Mobile
 Passionate about serverless and cloud-native application development,
with focus on app migration and modernization, app integration and data
analytics
 Blogging at https://TheFlyingMaverick.com
 Speaker at community events and meetups
 Organizer of “Canada’s Technology Triangle .NET User Group” in Kitchener,
Ontario
Agenda  Serverless refresher
 Serverless challenges
 Solutions through Durable Functions
 Storage provider options
 Demos
 Wrap up
The evolution of application platforms
4
Azure Functions
Run code when events occur
Event-driven scaling
No infrastructure management
Consumption pricing with free grant
What is Azure Functions?
Platform
Application
delivery
Operating
system
●●● ●●●
●●●
+
https://github.com/azure/azure-functions-host
(+other repos)
Azure Functions
host runtime
Azure Functions
Core Tools
Azure Functions
base Docker image
Azure Functions
.NET Docker image
Azure Functions
Node Docker image
●●●
Functions everywhere
Azure Functions Hosting Models
In-process
 Migrate from .NET Core 3.1 in-
process
 Need Durable Functions or
“rich” SDK type bindings
Isolated process
 Migrate from .NET 5 or .NET 6
isolated process
 Durable Functions now
supported in .NET 7*
Which one do I use?
What are the challenges in serverless?
Pattern #1: Function chaining
Problems:
• No visualization to show relationships between functions and queues
• Middle queues are an implementation detail – conceptual overhead
• Error handling adds a lot more complexity
Pattern #2: Fan-out/fan-in
Problems:
• Fanning-out is easy, but fanning-in is significantly more complicated
• Functions offers to help with this scenario today
• All the same problems as the previous pattern
Introducing Durable Functions
 Durable Functions is an extension of Azure Functions and is built on
top of the Durable Task Framework.
 Enables you to write long-running orchestration as a single function,
that is reliable, event-driven, and is stateful.
 Simplifies complex, stateful coordination requirements in serverless
applications
 Execution state is saved in an Azure Storage account, ensuring that
functions could recover automatically from any infrastructure failure
 Supports .NET (C#/F#), Java, JavaScript, TypeScript, Python, and
PowerShell.
Application Patterns
The primary use case for Durable Functions is simplifying complex,
stateful coordination requirements in serverless applications.
Typical application patterns that can benefit from Durable Functions:
 Function chaining
 Fan-out/fan-in
 Async HTTP APIs
 Monitoring
 Human interaction
 Aggregartor (stateful entities)
20
Durable Functions Components
What makes up Durable Functions:
 Starter Function
 Orchestrator Function
 Activity Function
Event Sourcing Log
Durable Functions uses a pattern called “Event Sourcing” to store state
in a backing storage account, which is how its made durable.
“Hello Amsterdam!”
[“Hello Amsterdam!”]
Orchestrator
Function
Activity
Function
Execution
History
var outputs = new List<string>();
outputs.Add(await context.CallActivityAsync<string>("SayHello", “Amsterdam"));
return outputs;
Orchestrator
Function
?
Activity
Function
“Hello Amsterdam!”
Orchestrator Started
Execution Started
Task Scheduled, SayHello, “Amsterdam”
Orchestrator Completed
Task Completed, “Hello Amsterdam!”
Orchestrator Started
Execution Completed, ["Hello Amsterdam!"]
Orchestrator Completed
How does it work?
Orchestration Constraints
 Orchestrator code must be deterministic
 Never use random numbers, DateTime.UtcNow, Guid.NewGuid(), etc.
 Use DurableOrchestrationContext.CurrentUtcDateTime
 Orchestrator code should be non-blocking. Never do I/O directly in
the orchestrator
 Do I/O in activity functions
 Don't write infinite loops
 Use DurableOrchestrationContext.ContinueAsNew()
Demo 1 – Hello Durable!
Function Chaining
Demo 2 – Configuration!
Demo 3 – Star Wars API!
Function Fan-out / Fan-in
New Storage Providers
Support for two new backend storage providers for storing durable runtime state,
“Netherite” and Microsoft SQL Server (including full support for Azure SQL
Database).
These new storage options allow you to:
• Run at higher scale
• Greater price-performance efficiency
• Greater portability compared to the default Azure Storage configuration
Limitations of Azure Storage Provider
Azure Storage has the following limitations:
• Limits on the number of transactions per second
• Strict data size limits for queue messages and Azure Table entities
• Hard to predict costs
• Can’t easily support certain enterprise business continuity requirements, such
as backup/restore and disaster recovery without data loss
• Azure only
Introducing “Netherite”
• The Netherite name originates from the world of Minecraft
• Developed by Microsoft Research, it combines Azure Event Hubs
with the FASTER database technology on top of Azure Page Blobs
• Supports significantly higher-throughput of orchestrations and
entities compared to other Durable storage providers
• More cost-effective for high-throughput loads
Performance
Benchmark
Single Azure Event Hubs throughput unit (1 TU), costing approximately $22/month USD on the Standard plan, running a
simple function-chaining sample with 5 activity calls running on the Azure Functions Elastic Premium plan.
Introducing SQL Server Provider
• SQL Server provider allows Durable Functions to run anywhere
• Azure SQL Database
• On-premises
• Docker Containers / Kubernetes
• IaaS
• Multi-Cloud
• Leverage your existing SQL Server investments
• Backup/restore
• Failover
• Encryption
• Compliance
• Easily integrate with existing SQL-based applications
Demo 4 – Netherite storage!
Alternate Storage Provider
Choosing the right storage provider
Azure Storage
 Generally available
 Dependencies:
 Azure Storage Account
(general purpose v1)
 Minimal setup
 Lowest minimum cost
 Consumption plan: Yes
 Elastic Premium plan: Yes
 Disconnected support: No
Netherite
 Generally available
 Dependencies:
 Azure Event Hubs
 Azure Storage Account
 Max throughput
 Lower cost at scale
 Consumption plan: No
 Elastic Premium plan -
requires runtime scale
monitoring
 Disconnected support: No
SQL Server
 Generally available
 Dependencies:
 SQL Server 2019 or Azure
SQL Database
 Runs anywhere
 Enterprise friendly
 Consumption plan: No
 Elastic Premium plan-
requires runtime scale
monitoring
 Disconnected support: Yes
In closing
 Input/output of functions should be serializable.
 Orchestration Functions can only call Activity Functions in the same
Function App.
 Don’t use an orchestration function to call a single activity function.
 Keep your orchestrations small.
 What changes together should be deployed together.
 Azure Durable Functions make managing state and complex
workflows easy and familiar.
What’s New
 Durable Function’s support for .NET 7.0 running in the isolated
worker process is now generally available (supports .NET 6.0 and
.NET Framework too!)
 However, not all features from in-process Durable Functions have
been migrated to the isolated worker. Known missing features are:
 Durable Entities
 CallHttpAsync
Let’s Connect
https://LinkedIn.com/in/CallonCampbell
@flying_maverick
Callon@CloudMavericks.ca
https://GitHub.com/CallonCampbell
References
• Azure Durable Functions documentation | Microsoft Learn
• Durable orchestrator code constraints - Azure Functions | Microsoft
Learn
• Handling errors in Durable Functions - Azure | Microsoft Learn
• Durable Functions storage providers - Azure | Microsoft Learn
• Overview of Durable Functions in the .NET isolated worker - Azure |
Microsoft Learn
• Task hubs in Durable Functions - Azure | Microsoft Learn
Thank You

More Related Content

What's hot

Windows Virtual Desktop Powered By Microsoft Azure
Windows Virtual Desktop Powered By Microsoft AzureWindows Virtual Desktop Powered By Microsoft Azure
Windows Virtual Desktop Powered By Microsoft AzureDavid J Rosenthal
 
Azure AD とアプリケーションを SAML 連携する際に陥る事例と対処方法について
Azure AD とアプリケーションを SAML 連携する際に陥る事例と対処方法についてAzure AD とアプリケーションを SAML 連携する際に陥る事例と対処方法について
Azure AD とアプリケーションを SAML 連携する際に陥る事例と対処方法についてShinya Yamaguchi
 
Azure Introduction
Azure IntroductionAzure Introduction
Azure Introductionbrunoterkaly
 
AZ-900T01 Microsoft Azure Fundamentals-01.pptx
AZ-900T01 Microsoft Azure Fundamentals-01.pptxAZ-900T01 Microsoft Azure Fundamentals-01.pptx
AZ-900T01 Microsoft Azure Fundamentals-01.pptxsayyedghazali
 
48. Azure Active Directory - Part 1
48. Azure Active Directory - Part 148. Azure Active Directory - Part 1
48. Azure Active Directory - Part 1Shawn Ismail
 
Azure Durable Functions
Azure Durable FunctionsAzure Durable Functions
Azure Durable FunctionsKarthikeyan VK
 
Azure fundamentals
Azure   fundamentalsAzure   fundamentals
Azure fundamentalsRaju Kumar
 
Microsoft Azure Active Directory
Microsoft Azure Active DirectoryMicrosoft Azure Active Directory
Microsoft Azure Active DirectoryDavid J Rosenthal
 
Az 104 session 6 azure networking part2
Az 104 session 6 azure networking part2Az 104 session 6 azure networking part2
Az 104 session 6 azure networking part2AzureEzy1
 
AWS 101: Cloud Computing Seminar (2012)
AWS 101: Cloud Computing Seminar (2012)AWS 101: Cloud Computing Seminar (2012)
AWS 101: Cloud Computing Seminar (2012)Amazon Web Services
 
AWS Interview Questions Part - 1 | AWS Interview Questions And Answers Part -...
AWS Interview Questions Part - 1 | AWS Interview Questions And Answers Part -...AWS Interview Questions Part - 1 | AWS Interview Questions And Answers Part -...
AWS Interview Questions Part - 1 | AWS Interview Questions And Answers Part -...Simplilearn
 
Azure active directory
Azure active directoryAzure active directory
Azure active directoryRaju Kumar
 
Azure AD の新しいデバイス管理パターンを理解しよう
Azure AD の新しいデバイス管理パターンを理解しようAzure AD の新しいデバイス管理パターンを理解しよう
Azure AD の新しいデバイス管理パターンを理解しようYusuke Kodama
 
Architecting for Success: Designing Secure GCP Landing Zone for Enterprises
Architecting for Success: Designing Secure GCP Landing Zone for EnterprisesArchitecting for Success: Designing Secure GCP Landing Zone for Enterprises
Architecting for Success: Designing Secure GCP Landing Zone for EnterprisesBhuvaneswari Subramani
 

What's hot (20)

Windows Virtual Desktop Powered By Microsoft Azure
Windows Virtual Desktop Powered By Microsoft AzureWindows Virtual Desktop Powered By Microsoft Azure
Windows Virtual Desktop Powered By Microsoft Azure
 
Azure AD とアプリケーションを SAML 連携する際に陥る事例と対処方法について
Azure AD とアプリケーションを SAML 連携する際に陥る事例と対処方法についてAzure AD とアプリケーションを SAML 連携する際に陥る事例と対処方法について
Azure AD とアプリケーションを SAML 連携する際に陥る事例と対処方法について
 
Azure Introduction
Azure IntroductionAzure Introduction
Azure Introduction
 
Introduction to Microsoft Azure Cloud
Introduction to Microsoft Azure CloudIntroduction to Microsoft Azure Cloud
Introduction to Microsoft Azure Cloud
 
AZ-900T01 Microsoft Azure Fundamentals-01.pptx
AZ-900T01 Microsoft Azure Fundamentals-01.pptxAZ-900T01 Microsoft Azure Fundamentals-01.pptx
AZ-900T01 Microsoft Azure Fundamentals-01.pptx
 
Microsoft power platform
Microsoft power platformMicrosoft power platform
Microsoft power platform
 
48. Azure Active Directory - Part 1
48. Azure Active Directory - Part 148. Azure Active Directory - Part 1
48. Azure Active Directory - Part 1
 
IAM Best Practices
IAM Best PracticesIAM Best Practices
IAM Best Practices
 
Azure Durable Functions
Azure Durable FunctionsAzure Durable Functions
Azure Durable Functions
 
Getting Started with AWS IoT
Getting Started with AWS IoTGetting Started with AWS IoT
Getting Started with AWS IoT
 
Azure fundamentals
Azure   fundamentalsAzure   fundamentals
Azure fundamentals
 
Microsoft Azure Active Directory
Microsoft Azure Active DirectoryMicrosoft Azure Active Directory
Microsoft Azure Active Directory
 
Az 104 session 6 azure networking part2
Az 104 session 6 azure networking part2Az 104 session 6 azure networking part2
Az 104 session 6 azure networking part2
 
Azure AD Connect
Azure AD ConnectAzure AD Connect
Azure AD Connect
 
AWS 101: Cloud Computing Seminar (2012)
AWS 101: Cloud Computing Seminar (2012)AWS 101: Cloud Computing Seminar (2012)
AWS 101: Cloud Computing Seminar (2012)
 
AWS Interview Questions Part - 1 | AWS Interview Questions And Answers Part -...
AWS Interview Questions Part - 1 | AWS Interview Questions And Answers Part -...AWS Interview Questions Part - 1 | AWS Interview Questions And Answers Part -...
AWS Interview Questions Part - 1 | AWS Interview Questions And Answers Part -...
 
Azure ARM Template
Azure ARM TemplateAzure ARM Template
Azure ARM Template
 
Azure active directory
Azure active directoryAzure active directory
Azure active directory
 
Azure AD の新しいデバイス管理パターンを理解しよう
Azure AD の新しいデバイス管理パターンを理解しようAzure AD の新しいデバイス管理パターンを理解しよう
Azure AD の新しいデバイス管理パターンを理解しよう
 
Architecting for Success: Designing Secure GCP Landing Zone for Enterprises
Architecting for Success: Designing Secure GCP Landing Zone for EnterprisesArchitecting for Success: Designing Secure GCP Landing Zone for Enterprises
Architecting for Success: Designing Secure GCP Landing Zone for Enterprises
 

Similar to Building stateful serverless orchestrations with Azure Durable Azure Functions.pptx

Azure Functions.pptx
Azure Functions.pptxAzure Functions.pptx
Azure Functions.pptxYachikaKamra
 
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration MondayBuilding workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration MondayBizTalk360
 
#SPFestSea Introduction to #Azure #Functions v2
#SPFestSea Introduction to #Azure #Functions v2#SPFestSea Introduction to #Azure #Functions v2
#SPFestSea Introduction to #Azure #Functions v2Vincent Biret
 
Durable Azure Functions
Durable Azure FunctionsDurable Azure Functions
Durable Azure FunctionsPushkar Saraf
 
Getting started with Azure Functions in Isolated Mode
Getting started with Azure Functions in Isolated ModeGetting started with Azure Functions in Isolated Mode
Getting started with Azure Functions in Isolated ModeCallon Campbell
 
BestOfBuild2021 - Azure Functions (15min).pptx
BestOfBuild2021 - Azure Functions (15min).pptxBestOfBuild2021 - Azure Functions (15min).pptx
BestOfBuild2021 - Azure Functions (15min).pptxCallon Campbell
 
#SPFestDC #Azure #Functions V2: What's new and getting started
#SPFestDC #Azure #Functions V2: What's new and getting started#SPFestDC #Azure #Functions V2: What's new and getting started
#SPFestDC #Azure #Functions V2: What's new and getting startedVincent Biret
 
GIDS 2019: Developing Apps with Containers, Functions and Cloud Services
GIDS 2019: Developing Apps with Containers, Functions and Cloud ServicesGIDS 2019: Developing Apps with Containers, Functions and Cloud Services
GIDS 2019: Developing Apps with Containers, Functions and Cloud ServicesPatrick Chanezon
 
Azure SQL Database Managed Instance - technical overview
Azure SQL Database Managed Instance - technical overviewAzure SQL Database Managed Instance - technical overview
Azure SQL Database Managed Instance - technical overviewGeorge Walters
 
Azure Serverless Toolbox
Azure Serverless ToolboxAzure Serverless Toolbox
Azure Serverless ToolboxJohan Eriksson
 
Azure from scratch part 3 By Girish Kalamati
Azure from scratch part 3 By Girish KalamatiAzure from scratch part 3 By Girish Kalamati
Azure from scratch part 3 By Girish KalamatiGirish Kalamati
 
Dockercon 2019 Developing Apps with Containers, Functions and Cloud Services
Dockercon 2019 Developing Apps with Containers, Functions and Cloud ServicesDockercon 2019 Developing Apps with Containers, Functions and Cloud Services
Dockercon 2019 Developing Apps with Containers, Functions and Cloud ServicesPatrick Chanezon
 
DCSF 19 Developing Apps with Containers, Functions and Cloud Services
DCSF 19 Developing Apps with Containers, Functions and Cloud ServicesDCSF 19 Developing Apps with Containers, Functions and Cloud Services
DCSF 19 Developing Apps with Containers, Functions and Cloud ServicesDocker, Inc.
 
Azure serverless architectures
Azure serverless architecturesAzure serverless architectures
Azure serverless architecturesBenoit Le Pichon
 
Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...
Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...
Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...VMware Tanzu
 
#SpFestSea azr203 Azure functions lessons learned
#SpFestSea azr203 Azure functions lessons learned#SpFestSea azr203 Azure functions lessons learned
#SpFestSea azr203 Azure functions lessons learnedVincent Biret
 

Similar to Building stateful serverless orchestrations with Azure Durable Azure Functions.pptx (20)

Azure Functions.pptx
Azure Functions.pptxAzure Functions.pptx
Azure Functions.pptx
 
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration MondayBuilding workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
 
Sky High With Azure
Sky High With AzureSky High With Azure
Sky High With Azure
 
#SPFestSea Introduction to #Azure #Functions v2
#SPFestSea Introduction to #Azure #Functions v2#SPFestSea Introduction to #Azure #Functions v2
#SPFestSea Introduction to #Azure #Functions v2
 
Durable Azure Functions
Durable Azure FunctionsDurable Azure Functions
Durable Azure Functions
 
Getting started with Azure Functions in Isolated Mode
Getting started with Azure Functions in Isolated ModeGetting started with Azure Functions in Isolated Mode
Getting started with Azure Functions in Isolated Mode
 
BestOfBuild2021 - Azure Functions (15min).pptx
BestOfBuild2021 - Azure Functions (15min).pptxBestOfBuild2021 - Azure Functions (15min).pptx
BestOfBuild2021 - Azure Functions (15min).pptx
 
Springboot Microservices
Springboot MicroservicesSpringboot Microservices
Springboot Microservices
 
#SPFestDC #Azure #Functions V2: What's new and getting started
#SPFestDC #Azure #Functions V2: What's new and getting started#SPFestDC #Azure #Functions V2: What's new and getting started
#SPFestDC #Azure #Functions V2: What's new and getting started
 
GIDS 2019: Developing Apps with Containers, Functions and Cloud Services
GIDS 2019: Developing Apps with Containers, Functions and Cloud ServicesGIDS 2019: Developing Apps with Containers, Functions and Cloud Services
GIDS 2019: Developing Apps with Containers, Functions and Cloud Services
 
Azure SQL Database Managed Instance - technical overview
Azure SQL Database Managed Instance - technical overviewAzure SQL Database Managed Instance - technical overview
Azure SQL Database Managed Instance - technical overview
 
Azure Serverless Toolbox
Azure Serverless ToolboxAzure Serverless Toolbox
Azure Serverless Toolbox
 
Azure Functions - Introduction
Azure Functions - IntroductionAzure Functions - Introduction
Azure Functions - Introduction
 
Azure from scratch part 3 By Girish Kalamati
Azure from scratch part 3 By Girish KalamatiAzure from scratch part 3 By Girish Kalamati
Azure from scratch part 3 By Girish Kalamati
 
Dockercon 2019 Developing Apps with Containers, Functions and Cloud Services
Dockercon 2019 Developing Apps with Containers, Functions and Cloud ServicesDockercon 2019 Developing Apps with Containers, Functions and Cloud Services
Dockercon 2019 Developing Apps with Containers, Functions and Cloud Services
 
DCSF 19 Developing Apps with Containers, Functions and Cloud Services
DCSF 19 Developing Apps with Containers, Functions and Cloud ServicesDCSF 19 Developing Apps with Containers, Functions and Cloud Services
DCSF 19 Developing Apps with Containers, Functions and Cloud Services
 
Azure serverless architectures
Azure serverless architecturesAzure serverless architectures
Azure serverless architectures
 
Azure functions
Azure functionsAzure functions
Azure functions
 
Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...
Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...
Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...
 
#SpFestSea azr203 Azure functions lessons learned
#SpFestSea azr203 Azure functions lessons learned#SpFestSea azr203 Azure functions lessons learned
#SpFestSea azr203 Azure functions lessons learned
 

More from Callon Campbell

Global Azure 2023 - Building Multitenant SaaS Applications in Azure
Global Azure 2023 - Building Multitenant SaaS Applications in AzureGlobal Azure 2023 - Building Multitenant SaaS Applications in Azure
Global Azure 2023 - Building Multitenant SaaS Applications in AzureCallon Campbell
 
Azure Durable Functions: The Festive Magic of Scalable Serverless Workflows f...
Azure Durable Functions: The Festive Magic of Scalable Serverless Workflows f...Azure Durable Functions: The Festive Magic of Scalable Serverless Workflows f...
Azure Durable Functions: The Festive Magic of Scalable Serverless Workflows f...Callon Campbell
 
Global Azure 2024 - On-Premises to Azure Cloud: .NET Web App Journey
Global Azure 2024 - On-Premises to Azure Cloud: .NET Web App JourneyGlobal Azure 2024 - On-Premises to Azure Cloud: .NET Web App Journey
Global Azure 2024 - On-Premises to Azure Cloud: .NET Web App JourneyCallon Campbell
 
Festive Tech Calendar 2021
Festive Tech Calendar 2021Festive Tech Calendar 2021
Festive Tech Calendar 2021Callon Campbell
 
Festive Tech Calendar 2022
Festive Tech Calendar 2022Festive Tech Calendar 2022
Festive Tech Calendar 2022Callon Campbell
 
Whats new in Azure Functions and .NET 6.pptx
Whats new in Azure Functions and .NET 6.pptxWhats new in Azure Functions and .NET 6.pptx
Whats new in Azure Functions and .NET 6.pptxCallon Campbell
 
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...Callon Campbell
 
Building scalable applications using serverless on the cloud
Building scalable applications using serverless on the cloudBuilding scalable applications using serverless on the cloud
Building scalable applications using serverless on the cloudCallon Campbell
 
Bringing Serverless into the Enterprise (Global Azure Virtual 2020)
Bringing Serverless into the Enterprise (Global Azure Virtual 2020)Bringing Serverless into the Enterprise (Global Azure Virtual 2020)
Bringing Serverless into the Enterprise (Global Azure Virtual 2020)Callon Campbell
 
Developing scalable enterprise serverless applications on azure with .net
Developing scalable enterprise serverless applications on azure with .netDeveloping scalable enterprise serverless applications on azure with .net
Developing scalable enterprise serverless applications on azure with .netCallon Campbell
 
Exposing services with Azure API Management
Exposing services with Azure API ManagementExposing services with Azure API Management
Exposing services with Azure API ManagementCallon Campbell
 
Build embedded and IoT solutions with Microsoft Windows IoT Core (BRK30077)
Build embedded and IoT solutions with Microsoft Windows IoT Core (BRK30077)Build embedded and IoT solutions with Microsoft Windows IoT Core (BRK30077)
Build embedded and IoT solutions with Microsoft Windows IoT Core (BRK30077)Callon Campbell
 
Centralized configuration with azure app configuration
Centralized configuration with azure app configurationCentralized configuration with azure app configuration
Centralized configuration with azure app configurationCallon Campbell
 
Creating Event Driven Applications with Azure Event Grid
Creating Event Driven Applications with Azure Event GridCreating Event Driven Applications with Azure Event Grid
Creating Event Driven Applications with Azure Event GridCallon Campbell
 
Getting Started with Azure Artifacts
Getting Started with Azure ArtifactsGetting Started with Azure Artifacts
Getting Started with Azure ArtifactsCallon Campbell
 
Serverless Orchestration with Azure Durable Functions
Serverless Orchestration with Azure Durable FunctionsServerless Orchestration with Azure Durable Functions
Serverless Orchestration with Azure Durable FunctionsCallon Campbell
 
Serverless Application Development with Azure
Serverless Application Development with AzureServerless Application Development with Azure
Serverless Application Development with AzureCallon Campbell
 
Introduction to Azure Event Grid
Introduction to Azure Event GridIntroduction to Azure Event Grid
Introduction to Azure Event GridCallon Campbell
 

More from Callon Campbell (20)

Global Azure 2023 - Building Multitenant SaaS Applications in Azure
Global Azure 2023 - Building Multitenant SaaS Applications in AzureGlobal Azure 2023 - Building Multitenant SaaS Applications in Azure
Global Azure 2023 - Building Multitenant SaaS Applications in Azure
 
Azure Durable Functions: The Festive Magic of Scalable Serverless Workflows f...
Azure Durable Functions: The Festive Magic of Scalable Serverless Workflows f...Azure Durable Functions: The Festive Magic of Scalable Serverless Workflows f...
Azure Durable Functions: The Festive Magic of Scalable Serverless Workflows f...
 
Global Azure 2024 - On-Premises to Azure Cloud: .NET Web App Journey
Global Azure 2024 - On-Premises to Azure Cloud: .NET Web App JourneyGlobal Azure 2024 - On-Premises to Azure Cloud: .NET Web App Journey
Global Azure 2024 - On-Premises to Azure Cloud: .NET Web App Journey
 
Festive Tech Calendar 2021
Festive Tech Calendar 2021Festive Tech Calendar 2021
Festive Tech Calendar 2021
 
Festive Tech Calendar 2022
Festive Tech Calendar 2022Festive Tech Calendar 2022
Festive Tech Calendar 2022
 
Whats new in Azure Functions and .NET 6.pptx
Whats new in Azure Functions and .NET 6.pptxWhats new in Azure Functions and .NET 6.pptx
Whats new in Azure Functions and .NET 6.pptx
 
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...
 
Building scalable applications using serverless on the cloud
Building scalable applications using serverless on the cloudBuilding scalable applications using serverless on the cloud
Building scalable applications using serverless on the cloud
 
Bringing Serverless into the Enterprise (Global Azure Virtual 2020)
Bringing Serverless into the Enterprise (Global Azure Virtual 2020)Bringing Serverless into the Enterprise (Global Azure Virtual 2020)
Bringing Serverless into the Enterprise (Global Azure Virtual 2020)
 
Developing scalable enterprise serverless applications on azure with .net
Developing scalable enterprise serverless applications on azure with .netDeveloping scalable enterprise serverless applications on azure with .net
Developing scalable enterprise serverless applications on azure with .net
 
Exposing services with Azure API Management
Exposing services with Azure API ManagementExposing services with Azure API Management
Exposing services with Azure API Management
 
Build embedded and IoT solutions with Microsoft Windows IoT Core (BRK30077)
Build embedded and IoT solutions with Microsoft Windows IoT Core (BRK30077)Build embedded and IoT solutions with Microsoft Windows IoT Core (BRK30077)
Build embedded and IoT solutions with Microsoft Windows IoT Core (BRK30077)
 
Centralized configuration with azure app configuration
Centralized configuration with azure app configurationCentralized configuration with azure app configuration
Centralized configuration with azure app configuration
 
Creating Event Driven Applications with Azure Event Grid
Creating Event Driven Applications with Azure Event GridCreating Event Driven Applications with Azure Event Grid
Creating Event Driven Applications with Azure Event Grid
 
Getting Started with Azure Artifacts
Getting Started with Azure ArtifactsGetting Started with Azure Artifacts
Getting Started with Azure Artifacts
 
Serverless Orchestration with Azure Durable Functions
Serverless Orchestration with Azure Durable FunctionsServerless Orchestration with Azure Durable Functions
Serverless Orchestration with Azure Durable Functions
 
Azure DevOps in Action
Azure DevOps in ActionAzure DevOps in Action
Azure DevOps in Action
 
Tour of Azure DevOps
Tour of Azure DevOpsTour of Azure DevOps
Tour of Azure DevOps
 
Serverless Application Development with Azure
Serverless Application Development with AzureServerless Application Development with Azure
Serverless Application Development with Azure
 
Introduction to Azure Event Grid
Introduction to Azure Event GridIntroduction to Azure Event Grid
Introduction to Azure Event Grid
 

Recently uploaded

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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...Neo4j
 
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...Martijn de Jong
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
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 Takeoffsammart93
 
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 AutomationSafe Software
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
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 StrategiesBoston Institute of Analytics
 
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 SavingEdi Saputra
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
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 DevelopmentsTrustArc
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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...
 
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...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
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
 
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
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
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
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 

Building stateful serverless orchestrations with Azure Durable Azure Functions.pptx

  • 1. Building stateful serverless orchestrations with Azure Durable Functions Callon Campbell Microsoft MVP | Azure @flying_maverick
  • 2. About me Callon Campbell Azure Architect | Developer Adastra Microsoft MVP | Azure  20 years enterprise development with Microsoft technologies – .NET (C#), Azure, ASP.NET, Desktop, SQL, and Mobile  Passionate about serverless and cloud-native application development, with focus on app migration and modernization, app integration and data analytics  Blogging at https://TheFlyingMaverick.com  Speaker at community events and meetups  Organizer of “Canada’s Technology Triangle .NET User Group” in Kitchener, Ontario
  • 3. Agenda  Serverless refresher  Serverless challenges  Solutions through Durable Functions  Storage provider options  Demos  Wrap up
  • 4. The evolution of application platforms 4
  • 5. Azure Functions Run code when events occur Event-driven scaling No infrastructure management Consumption pricing with free grant
  • 6. What is Azure Functions?
  • 7. Platform Application delivery Operating system ●●● ●●● ●●● + https://github.com/azure/azure-functions-host (+other repos) Azure Functions host runtime Azure Functions Core Tools Azure Functions base Docker image Azure Functions .NET Docker image Azure Functions Node Docker image ●●● Functions everywhere
  • 8. Azure Functions Hosting Models In-process  Migrate from .NET Core 3.1 in- process  Need Durable Functions or “rich” SDK type bindings Isolated process  Migrate from .NET 5 or .NET 6 isolated process  Durable Functions now supported in .NET 7* Which one do I use?
  • 9. What are the challenges in serverless?
  • 10. Pattern #1: Function chaining Problems: • No visualization to show relationships between functions and queues • Middle queues are an implementation detail – conceptual overhead • Error handling adds a lot more complexity
  • 11. Pattern #2: Fan-out/fan-in Problems: • Fanning-out is easy, but fanning-in is significantly more complicated • Functions offers to help with this scenario today • All the same problems as the previous pattern
  • 12. Introducing Durable Functions  Durable Functions is an extension of Azure Functions and is built on top of the Durable Task Framework.  Enables you to write long-running orchestration as a single function, that is reliable, event-driven, and is stateful.  Simplifies complex, stateful coordination requirements in serverless applications  Execution state is saved in an Azure Storage account, ensuring that functions could recover automatically from any infrastructure failure  Supports .NET (C#/F#), Java, JavaScript, TypeScript, Python, and PowerShell.
  • 13. Application Patterns The primary use case for Durable Functions is simplifying complex, stateful coordination requirements in serverless applications. Typical application patterns that can benefit from Durable Functions:  Function chaining  Fan-out/fan-in  Async HTTP APIs  Monitoring  Human interaction  Aggregartor (stateful entities) 20
  • 14. Durable Functions Components What makes up Durable Functions:  Starter Function  Orchestrator Function  Activity Function
  • 15. Event Sourcing Log Durable Functions uses a pattern called “Event Sourcing” to store state in a backing storage account, which is how its made durable.
  • 16. “Hello Amsterdam!” [“Hello Amsterdam!”] Orchestrator Function Activity Function Execution History var outputs = new List<string>(); outputs.Add(await context.CallActivityAsync<string>("SayHello", “Amsterdam")); return outputs; Orchestrator Function ? Activity Function “Hello Amsterdam!” Orchestrator Started Execution Started Task Scheduled, SayHello, “Amsterdam” Orchestrator Completed Task Completed, “Hello Amsterdam!” Orchestrator Started Execution Completed, ["Hello Amsterdam!"] Orchestrator Completed How does it work?
  • 17. Orchestration Constraints  Orchestrator code must be deterministic  Never use random numbers, DateTime.UtcNow, Guid.NewGuid(), etc.  Use DurableOrchestrationContext.CurrentUtcDateTime  Orchestrator code should be non-blocking. Never do I/O directly in the orchestrator  Do I/O in activity functions  Don't write infinite loops  Use DurableOrchestrationContext.ContinueAsNew()
  • 18. Demo 1 – Hello Durable! Function Chaining
  • 19. Demo 2 – Configuration!
  • 20. Demo 3 – Star Wars API! Function Fan-out / Fan-in
  • 21. New Storage Providers Support for two new backend storage providers for storing durable runtime state, “Netherite” and Microsoft SQL Server (including full support for Azure SQL Database). These new storage options allow you to: • Run at higher scale • Greater price-performance efficiency • Greater portability compared to the default Azure Storage configuration
  • 22. Limitations of Azure Storage Provider Azure Storage has the following limitations: • Limits on the number of transactions per second • Strict data size limits for queue messages and Azure Table entities • Hard to predict costs • Can’t easily support certain enterprise business continuity requirements, such as backup/restore and disaster recovery without data loss • Azure only
  • 23. Introducing “Netherite” • The Netherite name originates from the world of Minecraft • Developed by Microsoft Research, it combines Azure Event Hubs with the FASTER database technology on top of Azure Page Blobs • Supports significantly higher-throughput of orchestrations and entities compared to other Durable storage providers • More cost-effective for high-throughput loads
  • 24. Performance Benchmark Single Azure Event Hubs throughput unit (1 TU), costing approximately $22/month USD on the Standard plan, running a simple function-chaining sample with 5 activity calls running on the Azure Functions Elastic Premium plan.
  • 25. Introducing SQL Server Provider • SQL Server provider allows Durable Functions to run anywhere • Azure SQL Database • On-premises • Docker Containers / Kubernetes • IaaS • Multi-Cloud • Leverage your existing SQL Server investments • Backup/restore • Failover • Encryption • Compliance • Easily integrate with existing SQL-based applications
  • 26. Demo 4 – Netherite storage! Alternate Storage Provider
  • 27. Choosing the right storage provider Azure Storage  Generally available  Dependencies:  Azure Storage Account (general purpose v1)  Minimal setup  Lowest minimum cost  Consumption plan: Yes  Elastic Premium plan: Yes  Disconnected support: No Netherite  Generally available  Dependencies:  Azure Event Hubs  Azure Storage Account  Max throughput  Lower cost at scale  Consumption plan: No  Elastic Premium plan - requires runtime scale monitoring  Disconnected support: No SQL Server  Generally available  Dependencies:  SQL Server 2019 or Azure SQL Database  Runs anywhere  Enterprise friendly  Consumption plan: No  Elastic Premium plan- requires runtime scale monitoring  Disconnected support: Yes
  • 28. In closing  Input/output of functions should be serializable.  Orchestration Functions can only call Activity Functions in the same Function App.  Don’t use an orchestration function to call a single activity function.  Keep your orchestrations small.  What changes together should be deployed together.  Azure Durable Functions make managing state and complex workflows easy and familiar.
  • 29. What’s New  Durable Function’s support for .NET 7.0 running in the isolated worker process is now generally available (supports .NET 6.0 and .NET Framework too!)  However, not all features from in-process Durable Functions have been migrated to the isolated worker. Known missing features are:  Durable Entities  CallHttpAsync
  • 31. References • Azure Durable Functions documentation | Microsoft Learn • Durable orchestrator code constraints - Azure Functions | Microsoft Learn • Handling errors in Durable Functions - Azure | Microsoft Learn • Durable Functions storage providers - Azure | Microsoft Learn • Overview of Durable Functions in the .NET isolated worker - Azure | Microsoft Learn • Task hubs in Durable Functions - Azure | Microsoft Learn

Editor's Notes

  1. Serverless is the culmination of several iterations of cloud platforms. The evolution began with physical metal in the data center and progressed through Infrastructure as a Service (IaaS) and Platform as a Service (PaaS).
  2. Quick overview of Azure Functions - Don’t have to worry about infrastructure, that’s handled for you. - It will scale from not running to 1000s of instances and back down as needed. - As it scales you only pay for what you use.
  3. Dynamically and elastically scale to meet demand. Allows you as the developer get to focus on the fun stuff…your code and business logic. Everything else is taken cared for you. This drastically increases time to market.
  4. At the center of serverless is FaaS. Break it up into single responsibility. No state…but when you require state it gets tricky.
  5. Over the years we have seen an accelerated shift to adopting serverless and cloud native application architectures. Benefits to these architectures include decreased infrastructure costs and improved time to market, however it's still important to consider high availability and resiliency in your application design. In this session, Callon will talk about developing scalable enterprise serverless applications on Azure with .NET and use a real world example of a solution he developed and running in production.
  6. Function as a service (FaaS) platforms present a small delay on their first executions, known as cold start. This makes it challenging to adopt serverless functions for mission critical apps where a few seconds can make a huge difference.  Instead of billing per execution & mem used, Premium is based on the number of core seconds and mem used across warm and needed instances. Regardless of the function app timeout setting, 230 seconds (4min and 50sec) is the maximum amount of time that an HTTP triggered function can take to respond to a request. This is because of the default idle timeout of Azure Load Balancer. For longer processing times, consider using the Durable Functions async pattern or defer the actual work and return an immediate response.
  7. Better hardware, you can do a lot more now. Elastic scaling, bursts out nicely Networking options – I didn’t have time to show this but service endpoints and VNET integrations Reserved instance, helps with the cold start and long running. And custom containers.
  8. Functions is open source – runtime, core tools, docker images. Run it locally, its exactly what you see in the cloud. Very easy to get going and publish. Publish to Azure Functions services – consumption, app service, and premium (best of both worlds) There is also other places to run functions – Raspberry Pi, Kubernetes cluster, or on non-azure hosts and on-prem.
  9. For .NET, Azure Functions supports both in-process and isolated (out-of-process) execution models. Choose in-process if you are upgrading from .NET Core 3.1 Azure Functions or if you are looking for features, such as Durable Functions, that are currently only available to in-process apps. Isolated function apps provide more control of the function worker process and greater compatibility with libraries.
  10. Some sequencing that needs to happen and I have to chain them all together. If I want to parallel some work and then pull in the results into one function Waiting for external events Watcher pattern Long running http requests Human interaction and I don’t want to wait forever…I want a timeout. The answer to some of these is I don’t know. Let’s take a look at two patterns and how we can solve them
  11. Is an extension of Azure Functions and is built on top of the Durable Task Framework Allows you to write long-running, reliable, event-driven, and stateful logic while simplifying complex, stateful coordination in serverless applications The execution state is saved in an Azure Storage account, ensuring that functions can recover automatically from any infrastructure failure Ideal for situations where you want to chain functions together, fan-out/fan-in, HTTP API Async, Monitoring, Waiting on user interaction They automatically checkpoint their progress whenever the function awaits. Local state is never lost if the process recycles or the VM reboots.
  12. In Durable Functions we introduce the concept of an orchestrator function. The starter function triggers the orchestrator to start the execution. Often this starter function is an Http endpoint. Once the starter has called the orchestrator function, it goes to sleep for the rest of the day or until it’s triggered again. This reduces the cost significantly. The orchestrator function is responsible for calling and receiving the output of the activity functions (what you know as normal functions). The activity function output becomes part of the local state of the orchestrator function.
  13. So how does this all work?
  14. 23
  15. Orchestrator code must be deterministic, as it will be replayed multiple times and must produce the same result each time.
  16. .NET 7 with the new isolated process hosting model
  17. .NET 6 with the old in-process hosting model
  18. Azure Durable Functions now supports two new backend storage providers for storing durable runtime state, “Netherite” and Microsoft SQL Server (including full support for Azure SQL Database).   These new storage options allow you to: Run at higher scale Greater price-performance efficiency Greater portability compared to the default Azure Storage configuration
  19. The default Azure Storage configuration provider does have some limitations: Has limits on the number of transactions per second for a storage account Has strict data size limits for queue messages and Azure Table entities Costs can be hard to predict since they are per-transaction and have very limited support for batching Can’t easily support certain enterprise business continuity requirements, such as backup/restore and disaster recovery without data loss Can’t be used outside of the Azure cloud
  20. Looking at the GitHub repos - “Netherite” comes from the world of Minecraft and is the name of a rare material that is more durable than diamond, can float in lava, and cannot burn. The Netherite storage provider aspires to have similar qualities, but in the context of Durable Functions. Developed by Microsoft Research, it combines Azure Event Hubs with the FASTER database technology that sits on top of Azure Page Blobs Supports significantly higher-throughput and is more cost-effective for high-throughput loads
  21. The orchestrator used in this test is a simple function-chaining sample with 5 activity calls running on the Azure Functions Elastic Premium plan. As you can see the Netherite provider has considerable throughput compared to Azure Storage.
  22. While the Netherite provider was designed for maximum throughput, the Microsoft SQL Server provider for Durable Functions is designed for the needs of the enterprise, including the ability to decouple from the Azure cloud. With the ability to run Microsoft SQL anywhere, including on-premises servers, Edge devices, Linux Docker containers, on the Azure SQL Database serverless tier, and even on competitor cloud providers like AWS and GCP. This means you can run Durable Functions anywhere that Azure Functions can run, including your own Azure Arc-enabled Kubernetes clusters. The design of the Microsoft SQL storage provider for Durable Functions also makes it easy to integrate with existing SQL-based applications. When your function app starts up, it automatically provisions a set of tables, functions, and procedures in the target database within a “dt” schema (“dt” stands for Durable Tasks). You can easily monitor your orchestrations and entities by running SELECT queries against these tables. 
  23. The choice to use storage providers other than Azure Storage should be made carefully. Most function apps running in Azure should use the default Azure Storage provider for Durable Functions. However, there are important cost, scalability, and data management tradeoffs that should be considered when deciding whether to use an alternate storage provider. Either of these alternate storage providers can be configured without any code changes to your application if you so choose to try them out.