0
0
Azurecloud~30 mins

Durable Functions orchestration patterns in Azure - Mini Project: Build & Apply

Choose your learning style9 modes available
Durable Functions Orchestration Patterns
📖 Scenario: You are building a cloud application that needs to run multiple tasks in a reliable and organized way. You will use Azure Durable Functions to create an orchestration that manages these tasks step-by-step.
🎯 Goal: Create a Durable Functions orchestration that runs three activities in sequence, passing data between them, and returns the final result.
📋 What You'll Learn
Create an orchestration function named OrchestratorFunction.
Create three activity functions named ActivityOne, ActivityTwo, and ActivityThree.
Call the activity functions in sequence inside the orchestration.
Pass the output of each activity as input to the next.
Return the final result from the orchestration.
💡 Why This Matters
🌍 Real World
Durable Functions help build reliable cloud workflows that manage multiple steps, like order processing or data pipelines, ensuring tasks run in order and recover from failures.
💼 Career
Understanding Durable Functions orchestration is valuable for cloud developers and architects working with Azure to build scalable, fault-tolerant applications.
Progress0 / 4 steps
1
Create the activity functions
Create three activity functions named ActivityOne, ActivityTwo, and ActivityThree. Each function should accept a string input and return a string output that appends its name to the input. For example, ActivityOne should return the input plus the string "-ActivityOne".
Azure
Need a hint?

Define three async functions with the exact names and return the input string plus their function name.

2
Create the orchestration function
Create an orchestration function named OrchestratorFunction that accepts a context parameter. Inside it, create a variable input_name and set it to the string "Start".
Azure
Need a hint?

Define an async function named OrchestratorFunction with context parameter and set input_name to "Start".

3
Call activity functions in sequence
Inside OrchestratorFunction, call ActivityOne using context.call_activity with input_name as input and save the result to result_one. Then call ActivityTwo with result_one and save to result_two. Finally, call ActivityThree with result_two and save to result_three.
Azure
Need a hint?

Use await context.call_activity to call each activity with the correct input and save the output to the specified variables.

4
Return the final result from orchestration
At the end of OrchestratorFunction, return the variable result_three as the orchestration result.
Azure
Need a hint?

Use a return statement to send back result_three from the orchestration.