SlideShare a Scribd company logo
Serverless Orchestration with
Durable Functions
Callon Campbell
Systems Architect, Microsoft Azure MVP
Email: CallonCampbell@Outlook.com
Blog: https://TheFlyingMaverick.com
Twitter: @Flying_Maverick
Microsoft Azure
About me
2
Email: CallonCampbell@Outlook.com Twitter: @Flying_Maverick
Blog: http://TheFlyingMaverick.com LinkedIn: LinkedIn.com/in/calloncampbell
Website: http://ReflectInsight.com Slideshare: https://www.slideshare.net/calloncampbell
Callon Campbell - Microsoft Azure MVP
Systems Architect and Developer with 20 years of
experience developing desktop, mobile and web
enterprise applications using .NET, SQL Server,
Mobile and Azure technologies.
Co-creator of ReflectInsight, a .NET logging
framework and real-time Live Log Viewer.
Microsoft Azure
Agenda
•Serverless refresher
•Serverless challenges
•Solutions through Durable Functions
•Wrap up
3
Microsoft Azure
The evolution of application platforms
4
Microsoft Azure
What is serverless?
5
Microsoft Azure
Focus on code, not plumbing
6
Microsoft Azure
FaaS is at the center of serverless
7
Functions-as-a-service programming model use functions to achieve true serverless compute
Microsoft Azure
What is Azure Functions?
Microsoft Azure
What’s still hard?
9
Microsoft Azure
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
10
Microsoft Azure
Pattern #2: Fan-out/fan-in
11
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
Microsoft Azure
Introducing Durable Functions
• Write long-running orchestration as a single function while
maintaining local state
• Simplify complex transactions and coordination (chaining,
fan-out/fan-in, etc.) with a new function called orchestrator
function
• All of the above using code-only. No JSON schemas. No
UI/graphical designer
• Support for C#, F#, and JavaScript (in preview)
12
Microsoft Azure
Durable Functions Components
The Durable Functions has 3 components:
• Starter Function
• Orchestrator Function
• Activity Functions
13
Microsoft Azure
Prerequisites
•Install Visual Studio 2017 and ensure Azure
development workload is installed.
•Install the latest Azure Functions tools.
•Verify you have the Azure Storage Emulator installed
and running.
14
Demo 1
Function Chaining
Microsoft Azure
The Code
Function chaining
sample
This was scaffolded out
by the Visual Studio
templates.
16
Microsoft Azure
Starter Function
The Orchestration Client is the entry point (starter
function). Notice the OrchestrationClient attribute.
17
Microsoft Azure
URLs for checking status of execution
• StatusQueryGetUri - Get the status of a running
orchestration instance.
• SendEventPostUri - Send an event notification to a
running orchestration instance.
• TerminatePostUri - Terminate an instance of a running
orchestration.
• RewindPostUri - Rewind a running orchestration instance
to a replay events from a previous checkpoint.
18
Microsoft Azure
Orchestrator Function
Orchestration function is the conductor and responsible for
coordinating requests to activity functions
19
Microsoft Azure
Activity Function
The activity function is the equivalent of a regular
Azure Function with the difference – invoked by a
durable orchestrator.
20
Microsoft Azure
Triggering our Function
21
Microsoft Azure
“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
Microsoft Azure
Event Source Log
23
Demo 2
Fan-Out/Fan-In
Microsoft Azure
Fan-Out/Fan-In Sample
25
Microsoft Azure
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()
Microsoft Azure
Summary
•Azure Durable Functions make managing state and
complex workflows easy and familiar
•Now generally available and includes the following:
• Improved performance
• Large message support
• Application Insights diagnostics
• Logic Apps integration
27
Microsoft Azure
Thank you!
CallonCampbell@Outlook.com
TheFlyingMaverick.com
@Flying_Maverick
28
Microsoft Azure
References
• Durable Function Docs: http://aka.ms/durablefunctions
• GitHub:
• https://github.com/Azure/azure-functions-durable-extension
• https://github.com/Azure/durabletask/tree/azure-functions
• Orchestrator code constraints
• Develop Azure Functions using Visual Studio
• Serverless use cases and best practices
• Azure Durable Functions: before and after
29

More Related Content

What's hot (20)

PDF
Kubernetes Basics
Eueung Mulyana
 
PDF
Introduction to Kubernetes Workshop
Bob Killen
 
PPTX
Introduction to Azure Functions
Callon Campbell
 
PDF
GitHub Actions with Node.js
Stefan Stölzle
 
PPTX
Kubernetes for Beginners: An Introductory Guide
Bytemark
 
PPTX
Selenium-4-and-appium-2
Manoj Kumar Kumar
 
PDF
Api management best practices with wso2 api manager
Chanaka Fernando
 
PPTX
Breaking the Monolith
VMware Tanzu
 
PDF
Autoscaling Kubernetes
craigbox
 
PDF
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Edureka!
 
PDF
Understanding MicroSERVICE Architecture with Java & Spring Boot
Kashif Ali Siddiqui
 
PDF
Session 4 - Bringing the pieces together - Detailed review of a reference ex...
FIWARE
 
PDF
Drools 6.0 (Red Hat Summit)
Mark Proctor
 
PDF
Android studio
Paresh Mayani
 
PDF
Practical Microservice Architecture (edition 2022).pdf
Ahmed Misbah
 
PPTX
Introduction to microservices
Paulo Gandra de Sousa
 
PDF
Slide DevSecOps Microservices
Hendri Karisma
 
PPTX
Introduction to Serverless and Google Cloud Functions
Malepati Bala Siva Sai Akhil
 
PPTX
Dapr: distributed application runtime
Moaid Hathot
 
PPTX
Intro to Knative
Christian Posta
 
Kubernetes Basics
Eueung Mulyana
 
Introduction to Kubernetes Workshop
Bob Killen
 
Introduction to Azure Functions
Callon Campbell
 
GitHub Actions with Node.js
Stefan Stölzle
 
Kubernetes for Beginners: An Introductory Guide
Bytemark
 
Selenium-4-and-appium-2
Manoj Kumar Kumar
 
Api management best practices with wso2 api manager
Chanaka Fernando
 
Breaking the Monolith
VMware Tanzu
 
Autoscaling Kubernetes
craigbox
 
Kubernetes Architecture | Understanding Kubernetes Components | Kubernetes Tu...
Edureka!
 
Understanding MicroSERVICE Architecture with Java & Spring Boot
Kashif Ali Siddiqui
 
Session 4 - Bringing the pieces together - Detailed review of a reference ex...
FIWARE
 
Drools 6.0 (Red Hat Summit)
Mark Proctor
 
Android studio
Paresh Mayani
 
Practical Microservice Architecture (edition 2022).pdf
Ahmed Misbah
 
Introduction to microservices
Paulo Gandra de Sousa
 
Slide DevSecOps Microservices
Hendri Karisma
 
Introduction to Serverless and Google Cloud Functions
Malepati Bala Siva Sai Akhil
 
Dapr: distributed application runtime
Moaid Hathot
 
Intro to Knative
Christian Posta
 

Similar to Serverless Orchestration with Azure Durable Functions (20)

PPTX
Azure functions - Build apps faster with serverless architecture
Callon Campbell
 
PPTX
Introduction to serverless compute with azure functions
Callon Campbell
 
PPTX
Azure functions: Build apps faster with serverless architecture (March 2018)
Callon Campbell
 
PPTX
Serverless integrations using Azure Logic Apps (intro)
Callon Campbell
 
PPTX
Build mobile back-end (Restful API) by using Microsoft Azure Functions
Suki Huang
 
PPTX
Serverless Application Development with Azure
Callon Campbell
 
PDF
[SOT322] Serverless Side-by-Side Extensions with Azure Durable Functions - Wh...
Christian Lechner
 
PPTX
slides.pptx
abcabc794064
 
PDF
Serverless API with Azure Functions
Analben Mehta
 
PDF
Developing scalable enterprise serverless applications on azure with .net
Callon Campbell
 
PPTX
Azure in Developer Perspective
rizaon
 
PDF
Bringing Serverless into the Enterprise (Global Azure Virtual 2020)
Callon Campbell
 
PPTX
Go Serverless with Cosmos DB, Azure Functions and Blazor
Timothy McAliley
 
PPTX
RightScale Webinar: Best Practices: Software Development Strategies Using Win...
RightScale
 
PDF
Continuous Integration and Continuous Deployment (CI/CD) with WSO2 Enterprise...
WSO2
 
PPTX
Valentine with Angular js - Introduction
Senthil Kumar
 
PPTX
ServerLess by usama Azure fuctions.pptx
Usama Wahab Khan Cloud, Data and AI
 
PPTX
Modern ASP.NET Webskills
Caleb Jenkins
 
PPTX
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
BizTalk360
 
PPTX
Mastering Azure Durable Functions - Building Resilient and Scalable Workflows
Callon Campbell
 
Azure functions - Build apps faster with serverless architecture
Callon Campbell
 
Introduction to serverless compute with azure functions
Callon Campbell
 
Azure functions: Build apps faster with serverless architecture (March 2018)
Callon Campbell
 
Serverless integrations using Azure Logic Apps (intro)
Callon Campbell
 
Build mobile back-end (Restful API) by using Microsoft Azure Functions
Suki Huang
 
Serverless Application Development with Azure
Callon Campbell
 
[SOT322] Serverless Side-by-Side Extensions with Azure Durable Functions - Wh...
Christian Lechner
 
slides.pptx
abcabc794064
 
Serverless API with Azure Functions
Analben Mehta
 
Developing scalable enterprise serverless applications on azure with .net
Callon Campbell
 
Azure in Developer Perspective
rizaon
 
Bringing Serverless into the Enterprise (Global Azure Virtual 2020)
Callon Campbell
 
Go Serverless with Cosmos DB, Azure Functions and Blazor
Timothy McAliley
 
RightScale Webinar: Best Practices: Software Development Strategies Using Win...
RightScale
 
Continuous Integration and Continuous Deployment (CI/CD) with WSO2 Enterprise...
WSO2
 
Valentine with Angular js - Introduction
Senthil Kumar
 
ServerLess by usama Azure fuctions.pptx
Usama Wahab Khan Cloud, Data and AI
 
Modern ASP.NET Webskills
Caleb Jenkins
 
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
BizTalk360
 
Mastering Azure Durable Functions - Building Resilient and Scalable Workflows
Callon Campbell
 
Ad

More from Callon Campbell (20)

PPTX
Navigating API Hurdles - The Azure API Center Advantage
Callon Campbell
 
PPTX
Elevating AI Workflows: Integrating Azure API Management and Azure Functions ...
Callon Campbell
 
PPTX
Migrating to the Isolated worker process in Azure Functions .pptx
Callon Campbell
 
PPTX
Turbocharged Data - Leveraging Azure Data Explorer for Real-Time Insights fro...
Callon Campbell
 
PPTX
Discovering Insights - Azure Data Explorer Unleashed
Callon Campbell
 
PPTX
Ho-Ho-Hold onto Your Hats! Real-Time Data Magic from Santa’s Sleigh with Azur...
Callon Campbell
 
PPTX
Global Azure 2023 - Building Multitenant SaaS Applications in Azure
Callon Campbell
 
PPTX
Getting started with Azure Functions in Isolated Mode
Callon Campbell
 
PPTX
Azure Durable Functions: The Festive Magic of Scalable Serverless Workflows f...
Callon Campbell
 
PPTX
Global Azure 2024 - On-Premises to Azure Cloud: .NET Web App Journey
Callon Campbell
 
PPTX
Festive Tech Calendar 2021
Callon Campbell
 
PPTX
Festive Tech Calendar 2022
Callon Campbell
 
PPTX
BestOfBuild2021 - Azure Functions (15min).pptx
Callon Campbell
 
PPTX
Whats new in Azure Functions and .NET 6.pptx
Callon Campbell
 
PPTX
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...
Callon Campbell
 
PPTX
Building stateful serverless orchestrations with Azure Durable Azure Function...
Callon Campbell
 
PDF
Building scalable applications using serverless on the cloud
Callon Campbell
 
PPTX
Exposing services with Azure API Management
Callon Campbell
 
PDF
Build embedded and IoT solutions with Microsoft Windows IoT Core (BRK30077)
Callon Campbell
 
PPTX
Centralized configuration with azure app configuration
Callon Campbell
 
Navigating API Hurdles - The Azure API Center Advantage
Callon Campbell
 
Elevating AI Workflows: Integrating Azure API Management and Azure Functions ...
Callon Campbell
 
Migrating to the Isolated worker process in Azure Functions .pptx
Callon Campbell
 
Turbocharged Data - Leveraging Azure Data Explorer for Real-Time Insights fro...
Callon Campbell
 
Discovering Insights - Azure Data Explorer Unleashed
Callon Campbell
 
Ho-Ho-Hold onto Your Hats! Real-Time Data Magic from Santa’s Sleigh with Azur...
Callon Campbell
 
Global Azure 2023 - Building Multitenant SaaS Applications in Azure
Callon Campbell
 
Getting started with Azure Functions in Isolated Mode
Callon Campbell
 
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
Callon Campbell
 
Festive Tech Calendar 2021
Callon Campbell
 
Festive Tech Calendar 2022
Callon Campbell
 
BestOfBuild2021 - Azure Functions (15min).pptx
Callon Campbell
 
Whats new in Azure Functions and .NET 6.pptx
Callon Campbell
 
Global Azure 2022 - Architecting Modern Serverless APIs with Azure Functions ...
Callon Campbell
 
Building stateful serverless orchestrations with Azure Durable Azure Function...
Callon Campbell
 
Building scalable applications using serverless on the cloud
Callon Campbell
 
Exposing services with Azure API Management
Callon Campbell
 
Build embedded and IoT solutions with Microsoft Windows IoT Core (BRK30077)
Callon Campbell
 
Centralized configuration with azure app configuration
Callon Campbell
 
Ad

Recently uploaded (20)

PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
Advancing WebDriver BiDi support in WebKit
Igalia
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
Biography of Daniel Podor.pdf
Daniel Podor
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PPTX
Designing Production-Ready AI Agents
Kunal Rai
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Advancing WebDriver BiDi support in WebKit
Igalia
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Transcript: New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
Biography of Daniel Podor.pdf
Daniel Podor
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Designing Production-Ready AI Agents
Kunal Rai
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 

Serverless Orchestration with Azure Durable Functions

  • 1. Serverless Orchestration with Durable Functions Callon Campbell Systems Architect, Microsoft Azure MVP Email: [email protected] Blog: https://TheFlyingMaverick.com Twitter: @Flying_Maverick
  • 2. Microsoft Azure About me 2 Email: [email protected] Twitter: @Flying_Maverick Blog: http://TheFlyingMaverick.com LinkedIn: LinkedIn.com/in/calloncampbell Website: http://ReflectInsight.com Slideshare: https://www.slideshare.net/calloncampbell Callon Campbell - Microsoft Azure MVP Systems Architect and Developer with 20 years of experience developing desktop, mobile and web enterprise applications using .NET, SQL Server, Mobile and Azure technologies. Co-creator of ReflectInsight, a .NET logging framework and real-time Live Log Viewer.
  • 3. Microsoft Azure Agenda •Serverless refresher •Serverless challenges •Solutions through Durable Functions •Wrap up 3
  • 4. Microsoft Azure The evolution of application platforms 4
  • 5. Microsoft Azure What is serverless? 5
  • 6. Microsoft Azure Focus on code, not plumbing 6
  • 7. Microsoft Azure FaaS is at the center of serverless 7 Functions-as-a-service programming model use functions to achieve true serverless compute
  • 8. Microsoft Azure What is Azure Functions?
  • 10. Microsoft Azure 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 10
  • 11. Microsoft Azure Pattern #2: Fan-out/fan-in 11 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. Microsoft Azure Introducing Durable Functions • Write long-running orchestration as a single function while maintaining local state • Simplify complex transactions and coordination (chaining, fan-out/fan-in, etc.) with a new function called orchestrator function • All of the above using code-only. No JSON schemas. No UI/graphical designer • Support for C#, F#, and JavaScript (in preview) 12
  • 13. Microsoft Azure Durable Functions Components The Durable Functions has 3 components: • Starter Function • Orchestrator Function • Activity Functions 13
  • 14. Microsoft Azure Prerequisites •Install Visual Studio 2017 and ensure Azure development workload is installed. •Install the latest Azure Functions tools. •Verify you have the Azure Storage Emulator installed and running. 14
  • 16. Microsoft Azure The Code Function chaining sample This was scaffolded out by the Visual Studio templates. 16
  • 17. Microsoft Azure Starter Function The Orchestration Client is the entry point (starter function). Notice the OrchestrationClient attribute. 17
  • 18. Microsoft Azure URLs for checking status of execution • StatusQueryGetUri - Get the status of a running orchestration instance. • SendEventPostUri - Send an event notification to a running orchestration instance. • TerminatePostUri - Terminate an instance of a running orchestration. • RewindPostUri - Rewind a running orchestration instance to a replay events from a previous checkpoint. 18
  • 19. Microsoft Azure Orchestrator Function Orchestration function is the conductor and responsible for coordinating requests to activity functions 19
  • 20. Microsoft Azure Activity Function The activity function is the equivalent of a regular Azure Function with the difference – invoked by a durable orchestrator. 20
  • 22. Microsoft Azure “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
  • 26. Microsoft Azure 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()
  • 27. Microsoft Azure Summary •Azure Durable Functions make managing state and complex workflows easy and familiar •Now generally available and includes the following: • Improved performance • Large message support • Application Insights diagnostics • Logic Apps integration 27
  • 29. Microsoft Azure References • Durable Function Docs: http://aka.ms/durablefunctions • GitHub: • https://github.com/Azure/azure-functions-durable-extension • https://github.com/Azure/durabletask/tree/azure-functions • Orchestrator code constraints • Develop Azure Functions using Visual Studio • Serverless use cases and best practices • Azure Durable Functions: before and after 29

Editor's Notes

  • #4: Overview – Serverless and what are Azure Functions Dev tooling – Tools along with deployment and monitoring capabilities
  • #5: 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).
  • #6: With serverless, infrastructure is abstracted. Serverless further abstracts servers by focusing on event-driven code. Another feature of serverless is micro-billing.
  • #7: 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.
  • #8: At the center of serverless is FaaS. Break it up into single responsibility. No state…but when you require state it gets tricky.
  • #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
  • #13: Durable Functions is an open source framework for Azure Functions. Allows you to coordinate long running stateful workflows in code. They define workflows in code. No JSON schemas or designers are needed. They can call other functions synchronously and asynchronously. Output from called functions can be saved to local variables. They automatically checkpoint their progress whenever the function awaits. Local state is never lost if the process recycles or the VM reboots. Similar to Logic Apps but without a workflow designer.
  • #14: 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.
  • #18: Using this client, you start a new Orchestration function with the StartNewAsync(string, object) where the 1st parameter is the name of the durable orchestrator function and the 2nd parameter is the JSON-serializable input value which you would use to provide input data to the orchestrator. The second key thing to notice is that the orchestration client returns a CheckStatusResponse which contains a set of URLs for inspecting the status of an orchestration execution. The default endpoints you get back are:
  • #20: You will notice that the function is decorated with a OrchestrationTrigger attribute which exposes the DurableOrchestrationContext This context is what is used to invoke and interact with Activity functions. As mentioned above, orchestrator functions checkpoint their progress after each await. The above code therefore executes each Activity function in series, only progressing to the next function after the current invoked function returns. If you wanted to execute all of the above Activity functions in parallel, you would create a list of Task objects that represent the asynchronous operations and then call Task.WhenAll(List<Task<string>)
  • #21: It performs some logic in a stateless way and returns a response to it’s parent orchestration function. You will notice that this function is decorated with an ActivityTrigger attribute.
  • #22: We can easily test this out by pasting the starter function URL into the browser or via PostMan. We will then get back a list of URLs as mentioned earlier. If we navigate to the StatusQueryGerUri, we can observe the status of the durable function instance. In this example the orchestrator client is an HttpTrigger. It’s important to note that the OrchestratorClient can be triggered by any of the supported Azure Function triggers: TimerTrigger, QueueTrigger, CosmosDbTrigger, etc.
  • #23: 22
  • #27: Orchestrator code must be deterministic, as it will be replayed multiple times and must produce the same result each time.