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/durable-task-scheduler-auto-scaling-aca.md
+84-8Lines changed: 84 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,18 +12,94 @@ You can implement Kubernetes Event-Driven Autoscaling (KEDA) in container apps t
12
12
13
13
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.
14
14
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.
16
92
17
93
> [!NOTE]
18
94
> Although this sample uses the Durable Task .NET SDK, autoscaling is language-agnostic.
19
95
20
-
## Prerequisites
96
+
###Prerequisites
21
97
22
98
-[.NET 8 SDK](https://dotnet.microsoft.com/download/dotnet/8.0) or later
23
99
-[Docker](https://www.docker.com/products/docker-desktop/) (for building the image)
1. Clone the `Azure-Samples/Durable-Task-Scheduler` directory.
29
105
@@ -37,7 +113,7 @@ In this article, the [Autoscaling in Azure Container Apps sample]() demonstrates
37
113
azd auth login
38
114
```
39
115
40
-
## Deploy the solution using Azure Developer CLI
116
+
###Deploy the solution using Azure Developer CLI
41
117
42
118
1. Navigate into the `AutoscalingInACA` sample directory.
43
119
@@ -68,7 +144,7 @@ In this article, the [Autoscaling in Azure Container Apps sample]() demonstrates
68
144
- A `core` reference library that contains the Bicep modules used by the `azd` template
69
145
- Deploys the code using `azd deploy`
70
146
71
-
### Expected output
147
+
**Expected output**
72
148
73
149
```azdeveloper
74
150
Packaging services (azd package)
@@ -111,7 +187,7 @@ In this article, the [Autoscaling in Azure Container Apps sample]() demonstrates
111
187
SUCCESS: Your up workflow to provision and deploy to Azure completed in 10 minutes 34 seconds.
112
188
```
113
189
114
-
## Confirm successful deployment
190
+
###Confirm successful deployment
115
191
116
192
In the Azure portal, verify the orchestrations are running successfully.
117
193
@@ -135,7 +211,7 @@ In the Azure portal, verify the orchestrations are running successfully.
135
211
136
212
:::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.":::
137
213
138
-
## Understanding the custom scaler
214
+
###Understanding the custom scaler
139
215
140
216
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.
141
217
@@ -146,7 +222,7 @@ The custom scaler:
146
222
- Scales back down when the load decreases.
147
223
- Provides efficient resource utilization by matching capacity to demand.
148
224
149
-
## Confirm the scaler is working
225
+
###Confirm the scaler is working
150
226
151
227
Verify the autoscaling is functioning correctly in the deployed solution.
0 commit comments