Skip to content

Commit ff95826

Browse files
committed
add images and config details
Signed-off-by: Hannah Hunter <[email protected]>
1 parent 369d4f3 commit ff95826

File tree

2 files changed

+84
-8
lines changed

2 files changed

+84
-8
lines changed

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

Lines changed: 84 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,94 @@ You can implement Kubernetes Event-Driven Autoscaling (KEDA) in container apps t
1212

1313
Control autoscaling by setting the range of application replicas deployed in response to an orchestration being triggered. The scaler dynamically adjusts the number of replicas within that range, allowing your solution to handle spikes in the workload and prevent resource exhaustion.
1414

15-
In this article, 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.
15+
## Scaler configuration in the Azure portal
16+
17+
You can set the autoscaler configuration via the Azure portal, a Bicep template, and the Azure CLI.
18+
19+
# [Azure portal](#tab/portal)
20+
21+
:::image type="content" source="media/durable-task-scheduler-auto-scaling-aca/worker-app-log-stream.png" alt-text="Screenshot of the worker container's log stream in the Azure portal.":::
22+
23+
:::image type="content" source="media/durable-task-scheduler-auto-scaling-aca/worker-app-log-stream.png" alt-text="Screenshot of the worker container's log stream in the Azure portal.":::
24+
25+
| Field | Description | Example |
26+
| ----- | ----------- | ------- |
27+
| Min replicas | Minimum number of replicas allowed for the container revision at any given time. | 1 |
28+
| Max replicas | Maximum number of replicas allowed for the container revision at any given time. | 10 |
29+
| endpoint | The Durable Task Scheduler endpoint that the scaler connects to. | https://dts-ID.centralus.durabletask.io |
30+
| maxConcurrentWorkItemsCount | The maximum concurrent work items dispatched as an event to your compute, such as telling your compute to run an orchestration. | 1 |
31+
| taskhubName | The name of the task hub connected to the scheduler. | taskhub-ID |
32+
| 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. | [email protected] |
34+
35+
# [Bicep](#tab/bicep)
36+
37+
```bicep
38+
scale: {
39+
minReplicas: containerMinReplicas
40+
maxReplicas: containerMaxReplicas
41+
rules: [
42+
{
43+
name: 'dts-scaler-orchestration'
44+
custom: {
45+
type: 'azure-durabletask-scheduler'
46+
metadata: {
47+
endpoint: dtsEndpoint
48+
maxConcurrentWorkItemsCount: '1'
49+
taskhubName: taskHubName
50+
workItemType: 'Orchestration'
51+
}
52+
identity: scaleRuleIdentity
53+
}
54+
}
55+
]
56+
}
57+
```
58+
59+
| Field | Description | Example |
60+
| ----- | ----------- | ------- |
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` |
64+
| `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` |
66+
| `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` |
68+
69+
70+
# [Azure CLI](#tab/cli)
71+
72+
```azurecli
73+
74+
```
75+
76+
| Field | Description | Example |
77+
| ----- | ----------- | ------- |
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. | |
85+
86+
---
87+
88+
89+
## Experiment with the sample
90+
91+
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.
1692

1793
> [!NOTE]
1894
> Although this sample uses the Durable Task .NET SDK, autoscaling is language-agnostic.
1995
20-
## Prerequisites
96+
### Prerequisites
2197

2298
- [.NET 8 SDK](https://dotnet.microsoft.com/download/dotnet/8.0) or later
2399
- [Docker](https://www.docker.com/products/docker-desktop/) (for building the image)
24100
- [Azure Developer CLI](/developer/azure-developer-cli/install-azd)
25101

26-
## Set up your environment
102+
### Set up your environment
27103

28104
1. Clone the `Azure-Samples/Durable-Task-Scheduler` directory.
29105

@@ -37,7 +113,7 @@ In this article, the [Autoscaling in Azure Container Apps sample]() demonstrates
37113
azd auth login
38114
```
39115

40-
## Deploy the solution using Azure Developer CLI
116+
### Deploy the solution using Azure Developer CLI
41117

42118
1. Navigate into the `AutoscalingInACA` sample directory.
43119

@@ -68,7 +144,7 @@ In this article, the [Autoscaling in Azure Container Apps sample]() demonstrates
68144
- A `core` reference library that contains the Bicep modules used by the `azd` template
69145
- Deploys the code using `azd deploy`
70146

71-
### Expected output
147+
**Expected output**
72148

73149
```azdeveloper
74150
Packaging services (azd package)
@@ -111,7 +187,7 @@ In this article, the [Autoscaling in Azure Container Apps sample]() demonstrates
111187
SUCCESS: Your up workflow to provision and deploy to Azure completed in 10 minutes 34 seconds.
112188
```
113189

114-
## Confirm successful deployment
190+
### Confirm successful deployment
115191

116192
In the Azure portal, verify the orchestrations are running successfully.
117193

@@ -135,7 +211,7 @@ In the Azure portal, verify the orchestrations are running successfully.
135211

136212
:::image type="content" source="media/durable-task-scheduler-auto-scaling-aca/worker-app-log-stream.png" alt-text="Screenshot of the worker container's log stream in the Azure portal.":::
137213

138-
## Understanding the custom scaler
214+
### Understanding the custom scaler
139215

140216
This sample includes an `azure.yaml` configuration file. When you ran `azd up`, you deployed the entire sample solution to Azure, including a custom KEDA scaler for your container apps that automatically scales based on the Durable Task Scheduler's workload.
141217

@@ -146,7 +222,7 @@ The custom scaler:
146222
- Scales back down when the load decreases.
147223
- Provides efficient resource utilization by matching capacity to demand.
148224

149-
## Confirm the scaler is working
225+
### Confirm the scaler is working
150226

151227
Verify the autoscaling is functioning correctly in the deployed solution.
152228

Loading

0 commit comments

Comments
 (0)