Skip to content

Commit 3dac2fe

Browse files
committed
tweaks
Signed-off-by: Hannah Hunter <[email protected]>
1 parent 759c7a2 commit 3dac2fe

File tree

3 files changed

+35
-139
lines changed

3 files changed

+35
-139
lines changed

articles/azure-functions/durable/TOC.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,10 @@
130130
href: ./durable-task-scheduler/develop-with-durable-task-scheduler.md
131131
- name: Durable Task SDKs
132132
items:
133-
- name: Scheduler API
134-
href: ./durable-task-scheduler/durable-task-scheduler.md #placeholder
135133
- name: How-to guides
136134
items:
137135
- name: Autoscaling with the Durable Task SDKs in Azure Container Apps
138136
href: ./durable-task-scheduler/durable-task-scheduler-auto-scaling-aca.md
139-
- name: Run app on Azure Container Apps
140-
href: ./durable-task-scheduler/durable-task-scheduler.md #placeholder
141137
- name: Billing
142138
href: ./durable-task-scheduler/durable-task-scheduler-dedicated-sku.md
143139
- name: Troubleshoot

articles/azure-functions/durable/durable-task-scheduler/durable-task-scheduler-auto-scaling-aca.md

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ You can set the autoscaler configuration via the Azure portal, a Bicep template,
3030
| maxConcurrentWorkItemsCount | The maximum concurrent work items dispatched as an event to your compute, such as telling your compute to run an orchestration. | 1 |
3131
| taskhubName | The name of the task hub connected to the scheduler. | taskhub-ID |
3232
| workItemType | The work item type that is being dispatched. Options include Orchestration, Activity, or Entity. | Orchestration |
33-
| Managed identity | The user assigned or system assigned managed identity linked to the scheduler and task hub resource. Ensure the **Authenticate with a Managed Identity** checkbox is selected. | user@microsoft.com |
33+
| Managed identity | The user assigned managed identity linked to the scheduler and task hub resource. Ensure the **Authenticate with a Managed Identity** checkbox is selected. | someone@microsoft.com |
3434

3535
# [Bicep](#tab/bicep)
3636

@@ -58,34 +58,41 @@ scale: {
5858

5959
| Field | Description | Example |
6060
| ----- | ----------- | ------- |
61-
| `minReplicas` | Minimum number of replicas allowed for the container revision at any given time. | `containerMinReplicas` |
62-
| `maxReplicas` | Maximum number of replicas allowed for the container revision at any given time. | `containerMaxReplicas` |
63-
| `endpoint` | The Durable Task Scheduler endpoint that the scaler connects to. | `dtsEndpoint` |
61+
| `minReplicas` | Minimum number of replicas allowed for the container revision at any given time. | `1` |
62+
| `maxReplicas` | Maximum number of replicas allowed for the container revision at any given time. | `10` |
63+
| `endpoint` | The Durable Task Scheduler endpoint that the scaler connects to. | `https://dts-ID.centralus.durabletask.io` |
6464
| `maxConcurrentWorkItemsCount` | The maximum concurrent work items dispatched as an event to your compute, such as telling your compute to run an orchestration. | `1` |
65-
| `taskhubName` | The name of the task hub connected to the scheduler. | `taskHubName` |
65+
| `taskhubName` | The name of the task hub connected to the scheduler. | `myTaskHubName` |
6666
| `workItemType` | The work item type that is being dispatched. Options include Orchestration, Activity, or Entity. | `Orchestration` |
67-
| `identity` | The user assigned or system assigned managed identity linked to the scheduler and task hub resource. | `scaleRuleIdentity` |
67+
| `identity` | The user assigned managed identity linked to the scheduler and task hub resource. | `[email protected]` |
6868

6969

7070
# [Azure CLI](#tab/cli)
7171

7272
```azurecli
73-
73+
az containerapp create \
74+
--resource-group <RESOURCE_GROUP> \
75+
--name <APP_NAME> \
76+
--environment <ENVIRONMENT_ID> \
77+
--user-assigned <USER_ASSIGNED_IDENTITY_ID> \
78+
--scale-rule-name dtsscaler-orchestration \
79+
--scale-rule-type azure-durabletask-scheduler \
80+
--scale-rule-metadata "endpoint=<DTS-ENDPOINT>" "maxConcurrentWorkItemsCount=1" "taskhubName=<TASKHUB-NAME> "workItemType=Orchestration" \
81+
--scale-rule-identity <USER_ASSIGNED_IDENTITY_ID>
7482
```
7583

7684
| Field | Description | Example |
7785
| ----- | ----------- | ------- |
78-
| `minReplicas` | Minimum number of replicas allowed for the container revision at any given time. | |
79-
| `maxReplicas` | Maximum number of replicas allowed for the container revision at any given time. | |
80-
| `endpoint` | The Durable Task Scheduler endpoint that the scaler connects to. | |
81-
| `maxConcurrentWorkItemsCount` | The maximum concurrent work items dispatched as an event to your compute, such as telling your compute to run an orchestration. | |
82-
| `taskhubName` | The name of the task hub connected to the scheduler. | |
83-
| `workItemType` | The work item type that is being dispatched. Options include Orchestration, Activity, or Entity. | |
84-
| `identity` | The user assigned or system assigned managed identity linked to the scheduler and task hub resource. | |
86+
| `minReplicas` | Minimum number of replicas allowed for the container revision at any given time. | `1` |
87+
| `maxReplicas` | Maximum number of replicas allowed for the container revision at any given time. | `10` |
88+
| `endpoint` | The Durable Task Scheduler endpoint that the scaler connects to. | `https://dts-ID.centralus.durabletask.io` |
89+
| `maxConcurrentWorkItemsCount` | The maximum concurrent work items dispatched as an event to your compute, such as telling your compute to run an orchestration. | `1` |
90+
| `taskhubName` | The name of the task hub connected to the scheduler. | `myTaskHubName` |
91+
| `workItemType` | The work item type that is being dispatched. Options include Orchestration, Activity, or Entity. | `Orchestration` |
92+
| `scale-rule-identity` | The user assigned managed identity linked to the scheduler and task hub resource. | `[email protected]` |
8593

8694
---
8795

88-
8996
## Experiment with the sample
9097

9198
The [Autoscaling in Azure Container Apps sample]() demonstrates how to implement autoscaling with the Azure Durable Task Scheduler using the .NET SDK in Azure Container Apps. The function chaining application pattern showcases an orchestration workflow that benefits from dynamically scaling worker instances based on load.
@@ -238,3 +245,5 @@ Verify the autoscaling is functioning correctly in the deployed solution.
238245

239246
## Next steps
240247

248+
> [!div class="nextstepaction"]
249+
> [Learn more about the Durable Task Scheduler](./durable-task-scheduler.md)

articles/azure-functions/durable/durable-task-scheduler/quickstart-aca-azd-durable-task-sdk.md

Lines changed: 11 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@ zone_pivot_groups: df-languages
2121

2222
::: zone-end
2323

24-
::: zone pivot="csharp,python,java"
24+
::: zone pivot="java"
25+
26+
> [!IMPORTANT]
27+
> Currently, this quickstart sample isn't available for Java.
28+
29+
::: zone-end
30+
31+
::: zone pivot="csharp,python"
2532

2633
In this quickstart, you learn how to:
2734

@@ -57,16 +64,7 @@ Before you begin:
5764

5865
::: zone-end
5966

60-
::: zone pivot="java"
61-
62-
- Make sure you have [Java 8 or 11](https://www.java.com/en/download/).
63-
- Install [Docker](https://www.docker.com/products/docker-desktop/) for running the emulator.
64-
- Install [Azure Developer CLI](/azure/developer/azure-developer-cli/install-azd)
65-
- Clone the [Durable Task Scheduler GitHub repository](https://github.com/Azure-Samples/Durable-Task-Scheduler) to use the quickstart sample.
66-
67-
::: zone-end
68-
69-
::: zone pivot="csharp,python,java"
67+
::: zone pivot="csharp,python"
7068

7169
## Prepare the project
7270

@@ -90,15 +88,7 @@ cd /samples/durable-task-sdks/python/function-chaining
9088

9189
::: zone-end
9290

93-
::: zone pivot="java"
94-
95-
```bash
96-
cd /samples/durable-task-sdks/java/function-chaining
97-
```
98-
99-
::: zone-end
100-
101-
::: zone pivot="csharp,python,java"
91+
::: zone pivot="csharp,python"
10292

10393
## Deploy using Azure Developer CLI
10494

@@ -193,7 +183,7 @@ In the Azure portal, verify the orchestrations are running successfully.
193183

194184
::: zone-end
195185

196-
::: zone pivot="csharp,python,java"
186+
::: zone pivot="csharp,python"
197187

198188
## Understanding the code
199189

@@ -401,105 +391,6 @@ with DurableTaskSchedulerWorker(
401391
```
402392

403393

404-
::: zone-end
405-
406-
::: zone pivot="java"
407-
408-
### Client
409-
410-
The Client project:
411-
412-
- Uses the same connection string logic as the worker
413-
- Implements a sequential orchestration scheduler that:
414-
- Schedules 20 orchestration instances, one at a time
415-
- Waits 5 seconds between scheduling each orchestration
416-
- Tracks all orchestration instances in a list
417-
- Waits for all orchestrations to complete before exiting
418-
- Uses standard logging to show progress and results
419-
420-
```java
421-
// Create client using Azure-managed extensions
422-
DurableTaskClient client = DurableTaskSchedulerClientExtensions.createClientBuilder(connectionString).build();
423-
424-
// Start a new instance of the registered "ActivityChaining" orchestration
425-
String instanceId = client.scheduleNewOrchestrationInstance(
426-
"ActivityChaining",
427-
new NewOrchestrationInstanceOptions().setInput("Hello, world!"));
428-
logger.info("Started new orchestration instance: {}", instanceId);
429-
430-
// Block until the orchestration completes. Then print the final status, which includes the output.
431-
OrchestrationMetadata completedInstance = client.waitForInstanceCompletion(
432-
instanceId,
433-
Duration.ofSeconds(30),
434-
true);
435-
logger.info("Orchestration completed: {}", completedInstance);
436-
logger.info("Output: {}", completedInstance.readOutputAs(String.class))
437-
```
438-
439-
### Worker
440-
441-
#### Orchestration Implementation
442-
443-
The orchestration directly calls each activity in sequence using the standard `callActivity` method:
444-
445-
```java
446-
DurableTaskGrpcWorker worker = DurableTaskSchedulerWorkerExtensions.createWorkerBuilder(connectionString)
447-
.addOrchestration(new TaskOrchestrationFactory() {
448-
@Override
449-
public String getName() { return "ActivityChaining"; }
450-
451-
@Override
452-
public TaskOrchestration create() {
453-
return ctx -> {
454-
String input = ctx.getInput(String.class);
455-
String x = ctx.callActivity("Reverse", input, String.class).await();
456-
String y = ctx.callActivity("Capitalize", x, String.class).await();
457-
String z = ctx.callActivity("ReplaceWhitespace", y, String.class).await();
458-
ctx.complete(z);
459-
};
460-
}
461-
})
462-
.addActivity(new TaskActivityFactory() {
463-
@Override
464-
public String getName() { return "Reverse"; }
465-
466-
@Override
467-
public TaskActivity create() {
468-
return ctx -> {
469-
String input = ctx.getInput(String.class);
470-
StringBuilder builder = new StringBuilder(input);
471-
builder.reverse();
472-
return builder.toString();
473-
};
474-
}
475-
})
476-
.addActivity(new TaskActivityFactory() {
477-
@Override
478-
public String getName() { return "Capitalize"; }
479-
480-
@Override
481-
public TaskActivity create() {
482-
return ctx -> ctx.getInput(String.class).toUpperCase();
483-
}
484-
})
485-
.addActivity(new TaskActivityFactory() {
486-
@Override
487-
public String getName() { return "ReplaceWhitespace"; }
488-
489-
@Override
490-
public TaskActivity create() {
491-
return ctx -> {
492-
String input = ctx.getInput(String.class);
493-
return input.trim().replaceAll("\\s", "-");
494-
};
495-
}
496-
})
497-
.build();
498-
499-
// Start the worker
500-
worker.start();
501-
```
502-
503394
::: zone-end
504395

505396
## Next steps

0 commit comments

Comments
 (0)