0
0
Azurecloud~10 mins

Durable Functions orchestration patterns in Azure - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to start a Durable Functions orchestration.

Azure
const client = df.getClient(context); const instanceId = await client.startNew('[1]', undefined, input);
Drag options to blanks, or click blank then click option'
AhttpStart
BactivityFunction
CtriggerFunction
DorchestratorFunction
Attempts:
3 left
💡 Hint
Common Mistakes
Using the activity function name instead of the orchestrator function name.
Using the HTTP trigger function name here.
2fill in blank
medium

Complete the code to call an activity function from an orchestrator.

Azure
const result = yield context.df.callActivity('[1]', input);
Drag options to blanks, or click blank then click option'
AorchestratorFunction
BactivityFunction
ChttpStart
DtimerFunction
Attempts:
3 left
💡 Hint
Common Mistakes
Using the orchestrator function name instead of the activity function name.
Using the HTTP trigger function name.
3fill in blank
hard

Fix the error in the orchestration code to wait for multiple activities to complete.

Azure
const tasks = [context.df.callActivity('A', inputA), context.df.callActivity('B', inputB)]; const results = yield [1](tasks);
Drag options to blanks, or click blank then click option'
Acontext.df.Task.whenAll
Bcontext.df.Task.all
Ccontext.df.Task.waitAll
Dcontext.df.Task.waitAny
Attempts:
3 left
💡 Hint
Common Mistakes
Using a non-existent method like Task.all or Task.waitAll.
Using Task.waitAny which waits for any one task.
4fill in blank
hard

Fill both blanks to create a durable timer that waits for 5 minutes.

Azure
const expiration = context.df.currentUtcDateTime.addMinutes([1]); yield context.df.createTimer([2]);
Drag options to blanks, or click blank then click option'
A5
B10
Cexpiration
Dcontext.df.currentUtcDateTime
Attempts:
3 left
💡 Hint
Common Mistakes
Using 10 minutes instead of 5.
Passing the current time instead of the expiration time to createTimer.
5fill in blank
hard

Fill all three blanks to implement a fan-out/fan-in pattern that calls three activities and collects results.

Azure
const tasks = [context.df.callActivity([1], input1), context.df.callActivity([2], input2), context.df.callActivity([3], input3)]; const results = yield context.df.Task.whenAll(tasks);
Drag options to blanks, or click blank then click option'
A'activityOne'
B'activityTwo'
C'activityThree'
D'orchestratorFunction'
Attempts:
3 left
💡 Hint
Common Mistakes
Using the orchestrator function name instead of activity names.
Missing quotes around activity names.