Retention Policies - Create Or Replace
Create or Update a Retention Policy
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DurableTask/schedulers/{schedulerName}/retentionPolicies/default?api-version=2025-04-01-preview
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
resource
|
path | True |
string minLength: 1maxLength: 90 |
The name of the resource group. The name is case insensitive. |
scheduler
|
path | True |
string pattern: ^[a-zA-Z0-9-]{3,64}$ |
The name of the Scheduler |
subscription
|
path | True |
string (uuid) |
The ID of the target subscription. The value must be an UUID. |
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Body
Name | Type | Description |
---|---|---|
properties |
The resource-specific properties for this resource. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Resource 'RetentionPolicy' update operation succeeded |
|
201 Created |
Resource 'RetentionPolicy' create operation succeeded Headers
|
|
Other Status Codes |
Validation error: required parameters are missing |
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account |
Examples
RetentionPolicies_CreateOrReplace_MaximumSet
Sample request
PUT https://management.azure.com/subscriptions/194D3C1E-462F-4738-9025-092A628C06EB/resourceGroups/rgdurabletask/providers/Microsoft.DurableTask/schedulers/testscheduler/retentionPolicies/default?api-version=2025-04-01-preview
{
"properties": {
"retentionPolicies": [
{
"retentionPeriodInDays": 30
},
{
"retentionPeriodInDays": 10,
"orchestrationState": "Failed"
}
]
}
}
Sample response
{
"properties": {
"provisioningState": "Succeeded",
"retentionPolicies": [
{
"retentionPeriodInDays": 30
},
{
"retentionPeriodInDays": 10,
"orchestrationState": "Failed"
}
]
},
"id": "/subscriptions/194D3C1E-462F-4738-9025-092A628C06EB/resourceGroups/rgdurabletask/providers/Microsoft.DurableTask/schedulers/testscheduler/retentionPolicies/default",
"name": "default",
"type": "Microsoft.DurableTask/schedulers/retentionPolicies",
"systemData": {
"createdBy": "zshkmc",
"createdByType": "User",
"createdAt": "2025-03-31T23:34:09.612Z",
"lastModifiedBy": "ivqrae",
"lastModifiedByType": "User",
"lastModifiedAt": "2025-03-31T23:34:09.612Z"
}
}
Azure-AsyncOperation: https://contoso.com/operationstatus
{
"properties": {
"provisioningState": "Succeeded",
"retentionPolicies": [
{
"retentionPeriodInDays": 30
},
{
"retentionPeriodInDays": 10,
"orchestrationState": "Failed"
}
]
},
"id": "/subscriptions/194D3C1E-462F-4738-9025-092A628C06EB/resourceGroups/rgdurabletask/providers/Microsoft.DurableTask/schedulers/testscheduler/retentionPolicies/default",
"name": "default",
"type": "Microsoft.DurableTask/schedulers/retentionPolicies",
"systemData": {
"createdBy": "zshkmc",
"createdByType": "User",
"createdAt": "2025-03-31T23:34:09.612Z",
"lastModifiedBy": "ivqrae",
"lastModifiedByType": "User",
"lastModifiedAt": "2025-03-31T23:34:09.612Z"
}
}
Definitions
Name | Description |
---|---|
created |
The type of identity that created the resource. |
Error |
The resource management error additional info. |
Error |
The error detail. |
Error |
Error response |
Provisioning |
The status of the current operation |
Purgeable |
Purgeable orchestration state to be used in retention policies |
Retention |
A retention policy resource belonging to the scheduler |
Retention |
The properties of a retention policy |
Retention |
The retention policy settings for the resource |
system |
Metadata pertaining to creation and last modification of the resource. |
createdByType
The type of identity that created the resource.
Value | Description |
---|---|
User | |
Application | |
ManagedIdentity | |
Key |
ErrorAdditionalInfo
The resource management error additional info.
Name | Type | Description |
---|---|---|
info |
object |
The additional info. |
type |
string |
The additional info type. |
ErrorDetail
The error detail.
Name | Type | Description |
---|---|---|
additionalInfo |
The error additional info. |
|
code |
string |
The error code. |
details |
The error details. |
|
message |
string |
The error message. |
target |
string |
The error target. |
ErrorResponse
Error response
Name | Type | Description |
---|---|---|
error |
The error object. |
ProvisioningState
The status of the current operation
Value | Description |
---|---|
Succeeded |
Resource has been created. |
Failed |
Resource creation failed. |
Canceled |
Resource creation was canceled. |
Provisioning |
The resource is being provisioned |
Updating |
The resource is updating |
Deleting |
The resource is being deleted |
Accepted |
The resource create request has been accepted |
PurgeableOrchestrationState
Purgeable orchestration state to be used in retention policies
Value | Description |
---|---|
Completed |
The orchestration is completed |
Failed |
The orchestration is failed |
Terminated |
The orchestration is terminated |
Canceled |
The orchestration is canceled |
RetentionPolicy
A retention policy resource belonging to the scheduler
Name | Type | Description |
---|---|---|
id |
string (arm-id) |
Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}" |
name |
string |
The name of the resource |
properties |
The resource-specific properties for this resource. |
|
systemData |
Azure Resource Manager metadata containing createdBy and modifiedBy information. |
|
type |
string |
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" |
RetentionPolicyDetails
The properties of a retention policy
Name | Type | Description |
---|---|---|
orchestrationState |
The orchestration state to which this policy applies. If omitted, the policy applies to all purgeable orchestration states. |
|
retentionPeriodInDays |
integer (int32) |
The retention period in days after which the orchestration will be purged automatically |
RetentionPolicyProperties
The retention policy settings for the resource
Name | Type | Description |
---|---|---|
provisioningState |
The status of the last operation |
|
retentionPolicies |
The orchestration retention policies |
systemData
Metadata pertaining to creation and last modification of the resource.
Name | Type | Description |
---|---|---|
createdAt |
string (date-time) |
The timestamp of resource creation (UTC). |
createdBy |
string |
The identity that created the resource. |
createdByType |
The type of identity that created the resource. |
|
lastModifiedAt |
string (date-time) |
The timestamp of resource last modification (UTC) |
lastModifiedBy |
string |
The identity that last modified the resource. |
lastModifiedByType |
The type of identity that last modified the resource. |