You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-functions/durable/durable-task-scheduler/quickstart-portable-durable-task-sdks.md
+45-32Lines changed: 45 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
---
2
-
title: "Quickstart: Set a portable Durable Task SDK in your application to use Azure Functions Durable Task Scheduler (preview)"
3
-
description: Learn how to configure an existing app for the Azure Functions Durable Task Scheduler using the portable Durable Task SDKs.
2
+
title: "Quickstart: Configure Durable Task SDKs for your app with Azure Functions Durable Task Scheduler (preview)"
3
+
description: Learn how to configure an existing app for the Azure Functions Durable Task Scheduler using the Durable Task SDKs.
4
4
ms.topic: how-to
5
5
ms.date: 04/23/2025
6
6
zone_pivot_groups: df-languages
7
7
---
8
8
9
-
# Quickstart: Set a portable Durable Task SDK in your application to use Azure Functions Durable Task Scheduler (preview)
9
+
# Quickstart: Configure Durable Task SDKs for your app with Azure Functions Durable Task Scheduler (preview)
10
10
11
-
The Durable Task SDKs, or "portable SDKs", provide a lightweight client library for the Durable Task Scheduler. In this quickstart, you learn how to create orchestrations that leverage[the fan-out/fan-in application pattern](../durable/durable-functions-overview.md#fan-in-out) to perform parallel processing.
11
+
The Durable Task SDKsprovide a lightweight client library for the Durable Task Scheduler. In this quickstart, you learn how to create orchestrations that use[the fan-out/fan-in application pattern](../durable-functions-overview.md#fan-in-out) to perform parallel processing.
12
12
13
13
::: zone pivot="javascript"
14
14
@@ -65,13 +65,13 @@ Before you begin:
65
65
66
66
## Set up the Durable Task Scheduler emulator
67
67
68
-
The code looks for a deployed scheduler and task hub. If none are found, the code falls back to the emulator. The emulator simulates a scheduler and taskhub in a Docker container, making it ideal for the local development required in this quickstart.
68
+
The application code looks for a deployed scheduler and task hub resource. If none are found, the code falls back to the emulator. The emulator simulates a scheduler and task hub in a Docker container, making it ideal for the local development required in this quickstart.
69
69
70
70
::: zone-end
71
71
72
72
::: zone pivot="csharp"
73
73
74
-
1. From the `Azure-Samples/Durable-Task-Scheduler` root directory, navigate to the Python SDK sample dirctory.
74
+
1. From the `Azure-Samples/Durable-Task-Scheduler` root directory, navigate to the .NET SDK sample directory.
75
75
76
76
```bash
77
77
cd samples/portable-sdks/dotnet/FanOutFanIn
@@ -89,7 +89,7 @@ The code looks for a deployed scheduler and task hub. If none are found, the cod
89
89
docker run --name dtsemulator -d -p 8080:8080 -p 8082:8082 mcr.microsoft.com/dts/dts-emulator:v0.0.6
90
90
```
91
91
92
-
Since the example code automatically uses the default emulator settings, you don't need to set any environment variables.
92
+
Since the example code automatically uses the default emulator settings, you don't need to set any environment variables. The default emulator settings for this quickstart are:
93
93
- Endpoint: `http://localhost:8080`
94
94
- Task hub: `default`
95
95
@@ -98,7 +98,7 @@ Since the example code automatically uses the default emulator settings, you don
98
98
99
99
::: zone pivot="python"
100
100
101
-
1. From the `Azure-Samples/Durable-Task-Scheduler` root directory, navigate to the Python SDK sample dirctory.
101
+
1. From the `Azure-Samples/Durable-Task-Scheduler` root directory, navigate to the Python SDK sample directory.
102
102
103
103
```bash
104
104
cd samples/portable-sdks/python/fan-out-fan-in
@@ -116,15 +116,15 @@ Since the example code automatically uses the default emulator settings, you don
116
116
docker run --name dtsemulator -d -p 8080:8080 -p 8082:8082 mcr.microsoft.com/dts/dts-emulator:v0.0.6
117
117
```
118
118
119
-
Since the example code automatically uses the default emulator settings, you don't need to set any environment variables.
119
+
Since the example code automatically uses the default emulator settings, you don't need to set any environment variables. The default emulator settings for this quickstart are:
120
120
- Endpoint: `http://localhost:8080`
121
121
- Task hub: `default`
122
122
123
123
::: zone-end
124
124
125
125
::: zone pivot="java"
126
126
127
-
1. From the `Azure-Samples/Durable-Task-Scheduler` root directory, navigate to the Java SDK sample dirctory.
127
+
1. From the `Azure-Samples/Durable-Task-Scheduler` root directory, navigate to the Java SDK sample directory.
128
128
129
129
```bash
130
130
cd samples/portable-sdks/java/fan-out-fan-in
@@ -142,7 +142,7 @@ Since the example code automatically uses the default emulator settings, you don
142
142
docker run --name dtsemulator -d -p 8080:8080 -p 8082:8082 mcr.microsoft.com/dts/dts-emulator:v0.0.6
143
143
```
144
144
145
-
Since the example code automatically uses the default emulator settings, you don't need to set any environment variables.
145
+
Since the example code automatically uses the default emulator settings, you don't need to set any environment variables. The default emulator settings for this quickstart are:
146
146
- Endpoint: `http://localhost:8080`
147
147
- Task hub: `default`
148
148
@@ -189,7 +189,7 @@ The worker output shows:
189
189
190
190
The client output shows:
191
191
192
-
- Starting the orchestration with a list of work items
192
+
- The orchestration starting with a list of work items
193
193
- The unique orchestration instance ID
194
194
- The final aggregated results, showing each work item and its corresponding result
195
195
- Total count of processed items
@@ -218,13 +218,13 @@ Total items processed: 5
218
218
::: zone pivot="python"
219
219
220
220
221
-
1. If you're using a Python virtual environment, activate it now.
221
+
1. Activate a Python virtual environment.
222
222
223
223
# [Windows](#tab/windows)
224
224
225
225
```bash
226
226
python -m venv venv
227
-
source ./venv/bin/activate
227
+
/venv/Scripts/activate
228
228
```
229
229
230
230
# [Linux](#tab/linux)
@@ -250,7 +250,7 @@ Total items processed: 5
250
250
251
251
**Expected output**
252
252
253
-
You'll see output indicating that the worker has started and is waiting for work items.
253
+
You can see output indicating that the worker started and is waiting for work items.
254
254
255
255
```
256
256
Starting Fan Out/Fan In pattern worker...
@@ -260,12 +260,23 @@ Total items processed: 5
260
260
Successfully connected to http://localhost:8080. Waiting for work items...
261
261
```
262
262
263
-
1. In a new terminal (with the virtual environment activated, if applicable), start the virtual environment, and then run the client.
263
+
1. In a new terminal, activate the virtual environment and run the client.
264
264
265
-
```bash
266
-
source ./venv/bin/activate
267
-
python client.py
268
-
```
265
+
# [Windows](#tab/windows)
266
+
267
+
```bash
268
+
venv/Scripts/activate
269
+
python client.py
270
+
```
271
+
272
+
# [Linux](#tab/linux)
273
+
274
+
```bash
275
+
source ./venv/bin/activate
276
+
python client.py
277
+
```
278
+
279
+
---
269
280
270
281
You can provide the number of work items as an argument. If no argument is provided, the example runs 10 items by default.
271
282
@@ -290,12 +301,12 @@ The worker output shows:
290
301
291
302
The client output shows:
292
303
293
-
- Starting the orchestration with the specified number of work items.
304
+
- The orchestration starting with the specified number of work items.
294
305
- The unique orchestration instance ID.
295
306
- The final aggregated result, which includes:
296
-
- Total number of items processed
297
-
- Sum of all results (each item result is the square of its value)
298
-
- Average of all results
307
+
- The total number of items processed
308
+
- The sum of all results (each item result is the square of its value)
309
+
- The average of all results
299
310
300
311
#### Example output
301
312
@@ -365,14 +376,14 @@ Output: 60
365
376
366
377
::: zone pivot="csharp,python,java"
367
378
368
-
Now that you've run the project locally, you can also [deploy to Azure](#next-steps).
379
+
Now that you ran the project locally, you can now learn how to [deploy to Azure hosted in Azure Container Apps](#next-steps).
369
380
370
381
## View orchestration status and history
371
382
372
383
You can view the orchestration status and history via the [Durable Task Scheduler dashboard](./durable-task-scheduler-dashboard.md). By default, the dashboard runs on port 8082.
373
384
374
385
1. Navigate to http://localhost:8082 in your web browser.
375
-
1. Click the **default** task hub. The orchestration instance you just created is in the list.
386
+
1. Click the **default** task hub. The orchestration instance you created is in the list.
376
387
1. Click the orchestration instance ID to view the execution details, which include:
377
388
- The parallel execution of multiple activity tasks
378
389
- The fan-in aggregation step
@@ -383,19 +394,19 @@ You can view the orchestration status and history via the [Durable Task Schedule
383
394
384
395
::: zone pivot="csharp"
385
396
386
-
:::image type="content" source="media/quickstart-portable-durable-task-sdks/review-dashboard-dotnet.png" alt-text="Screenshot showing the orchestartion instance's details for the .NET sample.":::
397
+
:::image type="content" source="media/quickstart-portable-durable-task-sdks/review-dashboard-dotnet.png" alt-text="Screenshot showing the orchestration instance's details for the .NET sample.":::
387
398
388
399
::: zone-end
389
400
390
401
::: zone pivot="python"
391
402
392
-
:::image type="content" source="media/quickstart-portable-durable-task-sdks/review-dashboard-python.png" alt-text="Screenshot showing the orchestartion instance's details for the Python sample.":::
403
+
:::image type="content" source="media/quickstart-portable-durable-task-sdks/review-dashboard-python.png" alt-text="Screenshot showing the orchestration instance's details for the Python sample.":::
393
404
394
405
::: zone-end
395
406
396
407
::: zone pivot="java"
397
408
398
-
:::image type="content" source="media/quickstart-portable-durable-task-sdks/review-dashboard-java.png" alt-text="Screenshot showing the orchestartion instance's details for the Java sample.":::
409
+
:::image type="content" source="media/quickstart-portable-durable-task-sdks/review-dashboard-java.png" alt-text="Screenshot showing the orchestration instance's details for the Java sample.":::
399
410
400
411
::: zone-end
401
412
@@ -409,7 +420,7 @@ You can view the orchestration status and history via the [Durable Task Schedule
409
420
410
421
### The worker project
411
422
412
-
To demonstrate [the fan-out/fan-in pattern](../durable/durable-functions-overview.md#fan-in-out), the worker project orchestration creates parallel activity tasks and waits for all to complete. The orchestrator:
423
+
To demonstrate [the fan-out/fan-in pattern](../durable-functions-overview.md#fan-in-out), the worker project orchestration creates parallel activity tasks and waits for all to complete. The orchestrator:
413
424
414
425
1. Takes a list of work items as input.
415
426
1. Fans out by creating a separate task for each work item using `ProcessWorkItemActivity`.
@@ -524,7 +535,7 @@ var instance = await client.WaitForInstanceCompletionAsync(
524
535
525
536
### `worker.py`
526
537
527
-
To demonstrate [the fan-out/fan-in pattern](../durable/durable-functions-overview.md#fan-in-out), the worker project orchestration creates parallel activity tasks and waits for all to complete. The orchestrator:
538
+
To demonstrate [the fan-out/fan-in pattern](../durable-functions-overview.md#fan-in-out), the worker project orchestration creates parallel activity tasks and waits for all to complete. The orchestrator:
528
539
529
540
1. Receives a list of work items as input.
530
541
1. It "fans out" by creating parallel tasks for each work item (calling `process_work_item` for each one).
@@ -592,7 +603,7 @@ result = client.wait_for_orchestration_completion(
592
603
593
604
:::zonepivot="java"
594
605
595
-
Todemonstrate [thefan-out/fan-inpattern](../durable/durable-functions-overview.md#fan-in-out), the `FanOutFanInPattern` projectorchestrationcreatesparallelactivitytasksandwaitsfor all to complete. The orchestrator:
606
+
Todemonstrate [thefan-out/fan-inpattern](../durable-functions-overview.md#fan-in-out), the `FanOutFanInPattern` projectorchestrationcreatesparallelactivitytasksandwaitsfor all to complete. The orchestrator:
596
607
597
608
1. Takes a list of work items as input.
598
609
1. Fans out by creating a separate task for each work item using ``.
Now that you've run the sample locally using the Durable Task Scheduler emulator, try creating a scheduler and task hub resource and deploying to Azure Container Apps.
703
+
691
704
> [!div class="nextstepaction"]
692
705
> [Deploy to Azure](./develop-with-durable-task-scheduler.md)
0 commit comments