Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/skills/migrate-backend-to-dts/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,8 @@ If your orchestrations pass large inputs/outputs (>10 KB), enable large payload
"storageProvider": {
"type": "azureManaged",
"connectionStringName": "DURABLE_TASK_SCHEDULER_CONNECTION_STRING",
"largePayloadStorageEnabled": true,
"largePayloadStorageThresholdBytes": 10240
"payloadStorageEnabled": true,
"payloadStorageThresholdBytes": 10240
},
"hubName": "%TASKHUB_NAME%"
}
Expand All @@ -502,8 +502,8 @@ If your orchestrations pass large inputs/outputs (>10 KB), enable large payload
"storageProvider": {
"type": "azureManaged",
"connectionStringName": "DURABLE_TASK_SCHEDULER_CONNECTION_STRING",
"largePayloadStorageEnabled": true,
"largePayloadStorageThresholdBytes": 10240
"payloadStorageEnabled": true,
"payloadStorageThresholdBytes": 10240
},
"hubName": "default"
}
Expand Down
8 changes: 4 additions & 4 deletions .github/skills/migrate-backend-to-dts/references/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,17 +211,17 @@ DTS has a message size limit. For orchestrations that pass large inputs/outputs,
"storageProvider": {
"type": "azureManaged",
"connectionStringName": "DURABLE_TASK_SCHEDULER_CONNECTION_STRING",
"largePayloadStorageEnabled": true,
"largePayloadStorageThresholdBytes": 10240
"payloadStorageEnabled": true,
"payloadStorageThresholdBytes": 10240
},
"hubName": "%TASKHUB_NAME%"
}
}
}
```

- **`largePayloadStorageEnabled`** — set to `true` to enable blob offload
- **`largePayloadStorageThresholdBytes`** — payloads larger than this (default 10240 = 10 KB) are stored in blob
- **`payloadStorageEnabled`** — set to `true` to enable blob offload
- **`payloadStorageThresholdBytes`** — payloads larger than this (default 10240 = 10 KB) are stored in blob

Large payloads are stored in the Azure Storage account referenced by `AzureWebJobsStorage`.

Expand Down
4 changes: 2 additions & 2 deletions samples/durable-functions/dotnet/LargePayload/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ The sample enables these settings in `host.json`:
"type": "azureManaged",
"connectionStringName": "DTS_CONNECTION_STRING",
"payloadStorageEnabled": true,
"payloadStorageThresholdBytes": 900000
"payloadStorageThresholdBytes": 262144
},
"hubName": "%TASKHUB_NAME%"
}
Expand All @@ -54,7 +54,7 @@ When a payload exceeds `payloadStorageThresholdBytes`, the Durable Functions ext
3. replaces the in-band DTS message with a small blob reference
4. resolves that blob reference automatically before your function code reads the payload

The sample uses a deterministic, low-compressibility **1.5 MiB** payload by default and a **900,000-byte** threshold so externalization happens before the payload approaches the DTS 1 MiB message boundary.
The sample uses a deterministic, low-compressibility **1.5 MiB** payload by default and a **262,144-byte (256 KiB)** threshold so externalization happens before the payload approaches the DTS 1 MiB message boundary.

## Prerequisites

Expand Down
2 changes: 1 addition & 1 deletion samples/durable-functions/dotnet/LargePayload/host.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"type": "azureManaged",
"connectionStringName": "DTS_CONNECTION_STRING",
"payloadStorageEnabled": true,
"payloadStorageThresholdBytes": 900000
"payloadStorageThresholdBytes": 262144
},
"hubName": "%TASKHUB_NAME%"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,21 @@ The sample enables these settings in `host.json`:
"storageProvider": {
"type": "azureManaged",
"connectionStringName": "DTS_CONNECTION_STRING",
"largePayloadStorageEnabled": true,
"largePayloadStorageThresholdBytes": 900000
"payloadStorageEnabled": true,
"payloadStorageThresholdBytes": 262144
},
"hubName": "%TASKHUB_NAME%"
}
```

When a payload exceeds `largePayloadStorageThresholdBytes`, the Durable Functions extension:
When a payload exceeds `payloadStorageThresholdBytes`, the Durable Functions extension:

1. compresses the payload with gzip
2. stores it in blob storage using `AzureWebJobsStorage`
3. replaces the in-band DTS message with a small blob reference
4. resolves that blob reference automatically before your function code reads the payload

The sample uses **three deterministic, low-compressibility 1.5 MiB activity payloads** by default and a **900,000-byte** threshold so externalization happens before the payload approaches the DTS 1 MiB message boundary.
The sample uses **three deterministic, low-compressibility 1.5 MiB activity payloads** by default and a **262,144-byte (256 KiB)** threshold so externalization happens before the payload approaches the DTS 1 MiB message boundary.

## Prerequisites

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"storageProvider": {
"type": "azureManaged",
"connectionStringName": "DTS_CONNECTION_STRING",
"largePayloadStorageEnabled": true,
"largePayloadStorageThresholdBytes": 900000
"payloadStorageEnabled": true,
"payloadStorageThresholdBytes": 262144
},
"hubName": "%TASKHUB_NAME%"
}
Expand Down
6 changes: 3 additions & 3 deletions samples/durable-task-sdks/dotnet/LargePayload/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

const int OneMiB = 1024 * 1024;
const int DefaultPayloadSizeBytes = 1536 * 1024;
const int DefaultExternalizeThresholdBytes = 900_000;
const int DefaultExternalizeThresholdBytes = 262_144;
const int DefaultWaitTimeoutSeconds = 120;
const string OrchestrationName = "LargePayloadRoundTrip";
const string ActivityName = "EchoLargePayload";
Expand All @@ -27,11 +27,11 @@
?? "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None";

int defaultPayloadSizeBytes = GetPositiveInt(builder.Configuration, "PAYLOAD_SIZE_BYTES", DefaultPayloadSizeBytes);
int externalizeThresholdBytes = GetPositiveInt(builder.Configuration, "EXTERNALIZE_THRESHOLD_BYTES", DefaultExternalizeThresholdBytes);
int externalizeThresholdBytes = GetPositiveInt(builder.Configuration, "THRESHOLD_BYTES", DefaultExternalizeThresholdBytes);

if (externalizeThresholdBytes > OneMiB)
{
throw new InvalidOperationException($"EXTERNALIZE_THRESHOLD_BYTES must be 1 MiB or smaller. Value: {externalizeThresholdBytes}");
throw new InvalidOperationException($"THRESHOLD_BYTES must be 1 MiB or smaller. Value: {externalizeThresholdBytes}");
}

PayloadStorageSettings payloadStorageSettings = GetPayloadStorageSettings(builder.Configuration);
Expand Down
6 changes: 3 additions & 3 deletions samples/durable-task-sdks/dotnet/LargePayload/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ Durable Task Scheduler messages have a size limit. The SDK-side blob payload ext
- replacing the in-band message with a small blob reference
- resolving that reference automatically before your orchestrator or activity code reads it

The sample uses a deterministic, low-compressibility **1.5 MiB** payload by default and an offload threshold of **900,000 bytes** so payloads are externalized before they approach the 1 MiB scheduler ceiling.
The sample uses a deterministic, low-compressibility **1.5 MiB** payload by default and an offload threshold of **262,144 bytes (256 KiB)** so payloads are externalized before they approach the 1 MiB scheduler ceiling.

> The SDK extension requires `EXTERNALIZE_THRESHOLD_BYTES` to stay at or below `1,048,576` bytes.
> `THRESHOLD_BYTES` is a sample-only environment variable. The sample reads it and assigns it to the SDK's `LargePayloadStorageOptions.ThresholdBytes`, which must stay at or below `1,048,576` bytes (1 MiB).

## Prerequisites

Expand Down Expand Up @@ -94,7 +94,7 @@ The sample works out of the box locally, but you can override the defaults with
| `PAYLOAD_STORAGE_ACCOUNT_URI` | Blob account URI for identity-based storage access | unset |
| `PAYLOAD_CONTAINER_NAME` | Blob container used for externalized payloads | `durabletask-payloads` |
| `PAYLOAD_SIZE_BYTES` | Default payload size used by the run endpoint | `1572864` |
| `EXTERNALIZE_THRESHOLD_BYTES` | Blob offload threshold | `900000` |
| `THRESHOLD_BYTES` | Blob offload threshold | `262144` |
| `PAYLOAD_STORAGE_MANAGED_IDENTITY_CLIENT_ID` | Optional user-assigned managed identity client ID for storage | unset |
| `ASPNETCORE_URLS` | Listen URLs for the web host | framework default |

Expand Down
Loading