Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What are Durable Functions in Azure?
Durable Functions are an extension of Azure Functions that let you write stateful workflows in a serverless environment. They manage state, checkpoints, and restarts automatically.
Click to reveal answer
beginner
What is an orchestrator function in Durable Functions?
An orchestrator function defines the workflow logic. It calls activity functions and manages their execution order, retries, and state without losing progress.
Click to reveal answer
beginner
How do activity functions differ from orchestrator functions?
Activity functions perform the actual tasks or work units. Orchestrator functions coordinate these tasks but do not do the work themselves.
Click to reveal answer
intermediate
Why are Durable Functions good for long-running workflows?
Because they save state and checkpoints, Durable Functions can pause and resume workflows even after restarts or failures, making them reliable for long tasks.
Click to reveal answer
intermediate
What is the role of the Durable Task Framework in Durable Functions?
The Durable Task Framework handles the state, checkpoints, and messaging behind the scenes, so developers can focus on workflow logic without managing infrastructure.
Click to reveal answer
Which function type in Durable Functions manages the workflow logic?
AOrchestrator function
BActivity function
CTrigger function
DHTTP function
✗ Incorrect
The orchestrator function defines and manages the workflow logic by calling activity functions.
What happens if a Durable Function workflow is interrupted?
AIt automatically resumes from the last checkpoint
BIt loses all progress and restarts from the beginning
CIt stops permanently
DIt requires manual restart
✗ Incorrect
Durable Functions save checkpoints and state, allowing workflows to resume automatically after interruptions.
Which of these is NOT a benefit of Durable Functions?
AAutomatic state management
BManual server provisioning
CSupport for long-running workflows
DBuilt-in retries and error handling
✗ Incorrect
Durable Functions are serverless and do not require manual server provisioning.
What does an activity function do in Durable Functions?
ACoordinates workflow steps
BTriggers the workflow
CPerforms a specific task or action
DManages checkpoints
✗ Incorrect
Activity functions perform the actual work or tasks called by the orchestrator.
Which Azure service is extended by Durable Functions?
AAzure Logic Apps
BAzure App Service
CAzure Kubernetes Service
DAzure Functions
✗ Incorrect
Durable Functions are an extension of Azure Functions to support stateful workflows.
Explain how Durable Functions manage state and why this is useful for workflows.
Think about what happens if a workflow stops unexpectedly.
You got /4 concepts.
Describe the roles of orchestrator and activity functions in a Durable Function workflow.
Compare it to a manager and workers in a team.
You got /4 concepts.
Practice
(1/5)
1. What is the main purpose of Durable Functions in Azure?
easy
A. To create virtual machines
B. To store large amounts of data
C. To monitor network traffic
D. To manage long-running workflows reliably
Solution
Step 1: Understand Durable Functions role
Durable Functions are designed to handle workflows that take a long time and need to be reliable.
Step 2: Compare options
Options A, B, and D describe other Azure services, not Durable Functions.
Final Answer:
To manage long-running workflows reliably -> Option D
Hint: Durable Functions = reliable long workflows [OK]
Common Mistakes:
Confusing Durable Functions with storage services
Thinking Durable Functions create VMs
Assuming Durable Functions monitor networks
2. Which of the following is the correct way to define an orchestrator function in Azure Durable Functions?
easy
A. function orchestrator(context) { /* workflow code */ }
B. function activity(context) { /* workflow code */ }
C. async function orchestrator(context) { /* workflow code */ }
D. async function activity(context) { /* workflow code */ }
Solution
Step 1: Identify orchestrator function syntax
Orchestrator functions must be async to support awaiting activity calls.
Step 2: Differentiate activity and orchestrator functions
Options C and D define activity functions, not orchestrators.
Final Answer:
async function orchestrator(context) { /* workflow code */ } -> Option C
Quick Check:
Orchestrator = async function [OK]
Hint: Orchestrators are async functions [OK]
Common Mistakes:
Using non-async function for orchestrator
Confusing activity function syntax with orchestrator
Omitting async keyword
3. Given the following orchestrator code snippet, what will be the output if the activity function returns 'Hello'?
const result = yield context.callActivity('SayHello');
return result + ' World!';
medium
A. "Hello World!"
B. "World! Hello"
C. "Hello"
D. "World!"
Solution
Step 1: Understand callActivity result
The activity function returns 'Hello', which is assigned to result.
Step 2: Concatenate strings
The orchestrator returns result + ' World!', so 'Hello' + ' World!' = 'Hello World!'.
Final Answer:
"Hello World!" -> Option A
Quick Check:
Result + ' World!' = 'Hello World!' [OK]
Hint: callActivity returns value used in concatenation [OK]
Common Mistakes:
Reversing string order
Returning only activity result without addition
Ignoring yield keyword effect
4. Identify the error in this orchestrator function code:
async function orchestrator(context) {
const result = context.callActivity('Task');
return result;
}
medium
A. Function should not be async
B. Missing await or yield before callActivity
C. Incorrect function name
D. callActivity should be called outside orchestrator
Solution
Step 1: Check callActivity usage
callActivity returns a promise and must be awaited or yielded inside orchestrator.
Step 2: Identify missing await/yield
The code calls callActivity without await or yield, causing incorrect behavior.
Final Answer:
Missing await or yield before callActivity -> Option B
Quick Check:
callActivity needs await/yield [OK]
Hint: Always await or yield callActivity in orchestrator [OK]
Common Mistakes:
Forgetting await/yield on callActivity
Thinking async keyword is wrong here
Misplacing callActivity outside orchestrator
5. You want to create a workflow that calls two activity functions in sequence and combines their results. Which orchestrator code correctly implements this?