Skip to content

Commit 663a61f

Browse files
committed
added how to disable autopurge
1 parent ece0e89 commit 663a61f

File tree

1 file changed

+35
-10
lines changed

1 file changed

+35
-10
lines changed

articles/azure-functions/durable-task-scheduler/durable-task-scheduler-auto-purge.md

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ When configuring autopurge retention policy, you can set either a *specific* or
4242
}
4343
```
4444

45-
You can add specific policies to override the default which applies to orchestrations of all statuses. In the example below, the second and third policies override the default, so data associated with completed orchestrations is deleted immediately and those associated with failed orchestrations is purged after 60 days. However, because there's no specific policy for orchestrations of statuses canceled and terminated, the default policy still applies so these data are purged after 1 day:
45+
You can add specific policies to override the default policy that's applied to orchestrations of all statuses. In the example below, the second and third policies override the default policy, so data associated with completed orchestrations is deleted immediately and those associated with failed orchestrations is purged after 60 days. However, because there's no specific policy for orchestrations of statuses canceled and terminated, the default policy still applies so these data are purged after 1 day:
4646

4747
```json
4848
[
@@ -65,11 +65,11 @@ You can add specific policies to override the default which applies to orchestra
6565
# [Azure Resource Manager](#tab/arm)
6666

6767
# [Azure CLI](#tab/cli)
68-
Set the retention policy by running the following:
68+
Create or update the retention policy by running the following:
6969

7070
```azurecli
7171
az rest --method put --url "/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP/providers/Microsoft.DurableTask/schedulers/SCHEDULER_NAME/retentionPolicies/default?api-version=2025-04-01-preview" --body '{
72-
"name": "orchestration-retention",
72+
"name": "default",
7373
"type": "private.durabletask/schedulers/retentionPolicies",
7474
"properties": {
7575
"retentionPolicies": [
@@ -89,6 +89,36 @@ Set the retention policy by running the following:
8989
}'
9090
```
9191

92+
The following is returned upon successful creation:
93+
```json
94+
{
95+
"id": "/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.DurableTask/schedulers/SCHEDULER_NAMER/retentionPolicies/default",
96+
"name": "default",
97+
"properties": {
98+
"provisioningState": "Succeeded",
99+
"retentionPolicies": [
100+
{
101+
"orchestrationState": "Completed",
102+
"retentionPeriodInDays": 0
103+
},
104+
{
105+
"orchestrationState": "Failed",
106+
"retentionPeriodInDays": 30
107+
}
108+
]
109+
},
110+
"systemData": {
111+
"createdAt": "2025-04-23T23:41:17.3165122Z",
112+
"createdBy": "[email protected]",
113+
"createdByType": "User",
114+
"lastModifiedAt": "2025-04-23T23:41:17.3165122Z",
115+
"lastModifiedBy": "[email protected]",
116+
"lastModifiedByType": "User"
117+
},
118+
"type": "microsoft.durabletask/schedulers/retentionpolicies"
119+
}
120+
```
121+
92122
# [Azure portal](#tab/portal)
93123
Experience coming soon!
94124
---
@@ -97,15 +127,10 @@ Experience coming soon!
97127
# [Azure Resource Manager](#tab/arm)
98128

99129
# [Azure CLI](#tab/cli)
100-
To disable autopurge, run the following with the `retentionPolicies` property removed. The Durable Task Scheduler automatically stops cleaning up instances.
130+
To disable autopurge, simply delete the retention policies. The Durable Task Scheduler will stop cleaning orchestration data within 5 to 10 minutes.
101131

102132
```azurecli
103-
az rest --method put --url "/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP/providers/Microsoft.DurableTask/schedulers/SCHEDULER_NAME/retentionPolicies/default?api-version=2025-04-01-preview" --body '{
104-
"name": "orchestration-retention",
105-
"type": "private.durabletask/schedulers/retentionPolicies",
106-
"properties": {
107-
}
108-
}'
133+
az rest --method delete --url "/subscriptions/SUBSCRIPTION_ID/resourceGroups/RESOURCE_GROUP_NAME/providers/Microsoft.DurableTask/schedulers/SCHEDULER_NAMER/retentionPolicies/default?api-version=2025-04-01-preview"
109134
```
110135

111136
# [Azure portal](#tab/arm)

0 commit comments

Comments
 (0)