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-task-scheduler/durable-task-scheduler-auto-purge.md
+23-25Lines changed: 23 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,44 +9,42 @@ ms.date: 04/17/2025
9
9
10
10
Large volumes of completed orchestration instance data can lead to storage bloat, incur higher storage cost, and increase performance issues. The autopurge feature for Durable Task Scheduler offers a lightweight, configurable, and adoptable way to manage orchestration instance clean-up without manual intervention.
11
11
12
-
## How it works
12
+
Autopurge runs asynchronously in the background to avoid using too many system resources and to prevent blocking or delaying other Durable Task operations. While autopurge doesn't run on a precise schedule, the clean-up rate roughly matches your orchestration scheduling rate.
13
13
14
-
You enable autopurge by defining retention policies that control how long to keep completed, failed, or canceled orchestrations. Once enabled, autopurge deletes orchestration instances older than the retention period you set.
14
+
## Enable autopurge
15
15
16
-
Autopurge runs asynchronously in the background to avoid using too many system resources and blocking or delaying other Durable Task operations. While autopurge doesn't run on a precise schedule, the clean-up rate roughly matches your orchestration scheduling rate.
17
-
18
-
### Enable autopurge
16
+
Enable autopurge by defining retention policies that control how long to keep completed, failed, or canceled orchestrations. Once enabled, autopurge deletes orchestration instances older than the retention period you set.
19
17
20
18
You can configure autopurge using:
21
19
22
-
- Azure Resource Manager: Retention Policy Spec
23
-
- Azure CLI (coming soon)
24
-
- Azure portal (coming soon)
20
+
- Azure Resource Manager
21
+
- Azure CLI
22
+
- Azure portal
25
23
26
24
# [Azure Resource Manager](#tab/arm)
27
25
28
-
When configuring in Azure Resource Manager, you can set a *specific* retention policy. Specific policies are applied only to the `orchestrationState` specified.
26
+
When configuring in Azure Resource Manager, you can set either a *specific*or a *default*retention policy. Retention value can range from 0 (purge immediately after completion) to any large number.
29
27
30
-
```json
31
-
{
32
-
"retentionPeriodInDays": 1,
33
-
"orchestrationState": "Completed"
34
-
}
35
-
```
28
+
-**Specific policies** are applied only to the `orchestrationState` specified.
36
29
37
-
In this example, the retention policy tells Durable Task Scheduler to keep completed orchestrations for 1 day, and purge the rest.
30
+
```json
31
+
{
32
+
"retentionPeriodInDays": 1,
33
+
"orchestrationState": "Completed"
34
+
}
35
+
```
38
36
39
-
You can also set a default policy to apply to all purgeable statuses by omitting `orchestrationState`:
37
+
In this example, the retention policy tells Durable Task Scheduler to keep completed orchestrations for 1 day, and purge the rest.
40
38
41
-
```json
42
-
{
43
-
"retentionPeriodInDays": 2
44
-
}
45
-
```
39
+
- **Default policies** are applied to all purgeable statuses by omitting `orchestrationState`:
46
40
47
-
You can set retention from 0 (purge immediately after completion) to any large number.
41
+
```json
42
+
{
43
+
"retentionPeriodInDays": 2
44
+
}
45
+
```
48
46
49
-
[For more information, see the API reference spec for Durable Task Scheduler retention policies](/rest/api/durabletask/retention-policies/create-or-replace?view=rest-durabletask-2025-04-01-preview&preserve-view=true)
47
+
[For more information, see the API reference spec for Durable Task Scheduler retention policies.](/rest/api/durabletask/retention-policies/create-or-replace?view=rest-durabletask-2025-04-01-preview&preserve-view=true)
50
48
51
49
# [Azure CLI](#tab/cli)
52
50
todo
@@ -59,7 +57,7 @@ todo
59
57
> [!NOTE]
60
58
> If both a specific and a default policy are set, the specific policy takes priority.
0 commit comments