This Azure tutorial will discuss a complete Azure Durable Functions Tutorial. So, before we start the discussion on What are durable functions in Azure, you should know what an Azure function is.
What are Azure Durable Functions
Azure Durable Function is an extended version of Azure Function that helps us develop stateful functions in a serverless environment, and stateful workflows using the code with the help of a different type of function called an orchestrator function.
As discussed above, Azure Durable Functions are an extension of Azure Functions. Compared to Azure Functions, Azure Durable Functions are more capable in terms of functionality, Performance, etc.
Azure Durable functions can do what an Azure Function can do with many extra features to automate the business process. Working with the Workflow from code becomes easy with the help of Durable functions.
Serverless
As we already know, Azure functions are part of the serverless architecture, meaning we need to concentrate on writing the Function code without causing any headaches for the Infrastructure.
Deploying our Azure function to Azure does not cause us any headaches regarding Infrastructure, even though we don’t have to define explicitly how many servers we want to execute our Azure Function. Thanks to the Azure Function runtime, we can define the number of servers we need and handle the Overall load.
Why Durable Functions?
This is very important to know. Why should we go with the Durable Functions? Some things are difficult to implement with the regular Azure Functions.
So, here are the Durable Functions that help us to perform many activities, if you want to define the workflow in your code, if you’re going to implement error handling in the code with the help of workflows, if we’re going to trigger parallel execution, etc
Durable Functions are stateful and help track the workflow status in each stage. Because of their stateful nature, they also help implement some advanced workflows for our business.
Supported Languages for Durable Functions
As of now, below are the languages that are supported to build Durable Functions
- It supports the C# language.
- Durable function version 1.7.0 or later is supported by the Azure Function runtime version 2.x.
- Durable function version 1.8.5 or later version supports Python.
- Function version 1.x supports F# script.
- PowerShell supports the durable function version 2.2.2 and the Azure function version 3.x, which is currently in Public Preview.
Main Components for Durable Functions
The concepts below are the main components of durable functions. They play a vital role when working with the Azure Durable Function.
- Orchestrator Client
- Orchestrator Function
- Activity Function
Orchestrator Client
The Orchestrator client starts and stops the orchestrator functions and monitors them. When you create an HTTP-triggered function initially, you can call that HTTP-triggered function the Orchestrator Client. This is responsible for getting the request, and then it starts the orchestrator function. So, this is the first step in the whole process.
using Microsoft.Azure.WebJobs.Extensions.DurableTask;
using Newtonsoft.Json;
using System.Net;
[FunctionName("Function1")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req, IDurableOrchestrationClient starter,
ILogger log)
{Orchestrator Function
The Orchestrator Function plays a significant role in building the Durable function, which is the heart of the Durable function solution. In this function, you need to write the workflow in code. You can call the Activity function from the Orchestrator Function inside the code. You can also call another Orchestrator Function and Sub Orchestrator Function from this primary Orchestrator Function.
Activity Function
The activity Function is the basic unit of durable function that executes one task. You can call many activity functions inside the orchestration function. Each one of the Activity functions executes one task.

Key Benefits of Durable Functions
There are many benefits of durable functions. There are a few essential tasks that we cannot perform with the help of regular Azure Functions, but we can perform those tasks efficiently with the help of Durable functions. Let’s discuss a few key benefits of Durable functions regarding Workflow.
Build Workflows in Code
With the help of the Durable Functions, we can comfortably build workflows from our code. These workflows help us automate our business processes and handle errors in our code, which is very important.
Parallel activities
The Azure function can help you perform multiple parallel activities if you are using multi-step workflows. That helps to achieve complex workflows.
Can Implement the Time Out Option in Workflow
In case of any significant delay in response, while running the workflow, you can set the timeout option for the workflows easily with the help of the Durable function.
Track the Workflow Progress Easily
Durable Function can help you to track the progress of a workflow easily with the help of the REST API implementation. You can use the query status API to track the workflow progress easily.
Easy Cancellation of the Workflow
With the help of Rest API and a durable function, you can easily cancel the in-progress workflow. It was not accessible with regular Azure Functions.
Different Patterns Of Durable Functions
Multiple Function execution
The durable function helps you execute a sequence of functions, i.e., the chain of functions, quickly. When I say chain of functions, I mean the functions will execute sequentially. The output of the first function will be the input for the second function, and the output of the second function will be the input for the third function.

Supports Fan-out/fan-in
The durable Function supports the Fan-out/fan-in pattern. You might wonder what exactly the meaning of this pattern is. According to this pattern, all the functions execute in parallel and then