From 5a2775e1ba25f0f551d9c747a953d4a1eb9d772a Mon Sep 17 00:00:00 2001 From: Tomer Rosenthal <17064840+torosent@users.noreply.github.com> Date: Wed, 1 Jul 2026 10:07:47 -0700 Subject: [PATCH 1/3] Fix LargePayload SDK sample: rename env var to THRESHOLD_BYTES, default 256 KiB - Rename the sample env var EXTERNALIZE_THRESHOLD_BYTES to THRESHOLD_BYTES. - Change the default offload threshold from 900,000 to 262,144 bytes (256 KiB) to match the SDK default in Microsoft.DurableTask.Extensions.AzureBlobPayloads. - Correct a misleading README note: THRESHOLD_BYTES is sample-only glue mapped to the SDK's LargePayloadStorageOptions.ThresholdBytes (the option that must stay <= 1 MiB); the SDK extension does not read the env var itself. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- samples/durable-task-sdks/dotnet/LargePayload/Program.cs | 6 +++--- samples/durable-task-sdks/dotnet/LargePayload/README.md | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/durable-task-sdks/dotnet/LargePayload/Program.cs b/samples/durable-task-sdks/dotnet/LargePayload/Program.cs index c8c394fa..dd8fe4d0 100644 --- a/samples/durable-task-sdks/dotnet/LargePayload/Program.cs +++ b/samples/durable-task-sdks/dotnet/LargePayload/Program.cs @@ -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"; @@ -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); diff --git a/samples/durable-task-sdks/dotnet/LargePayload/README.md b/samples/durable-task-sdks/dotnet/LargePayload/README.md index fead0dff..aef0b372 100644 --- a/samples/durable-task-sdks/dotnet/LargePayload/README.md +++ b/samples/durable-task-sdks/dotnet/LargePayload/README.md @@ -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 @@ -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 | From 696d3d75aad7abaca9560c54de76ed42879252f4 Mon Sep 17 00:00:00 2001 From: Tomer Rosenthal <17064840+torosent@users.noreply.github.com> Date: Wed, 1 Jul 2026 10:17:32 -0700 Subject: [PATCH 2/3] Fix Durable Functions large payload samples: correct host.json keys, set 256 KiB - LargePayloadFanOutFanIn used unbound host.json keys (largePayloadStorageEnabled / largePayloadStorageThresholdBytes), so payload offload was effectively disabled. Rename to the bound payloadStorageEnabled / payloadStorageThresholdBytes, per HostJsonOptions in WebJobs.Extensions.DurableTask.AzureManaged. - Set both Durable Functions samples' threshold to 262,144 bytes (256 KiB) to match the SDK default. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- samples/durable-functions/dotnet/LargePayload/README.md | 4 ++-- samples/durable-functions/dotnet/LargePayload/host.json | 2 +- .../dotnet/LargePayloadFanOutFanIn/README.md | 8 ++++---- .../dotnet/LargePayloadFanOutFanIn/host.json | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/samples/durable-functions/dotnet/LargePayload/README.md b/samples/durable-functions/dotnet/LargePayload/README.md index 777dc47c..e6bc9683 100644 --- a/samples/durable-functions/dotnet/LargePayload/README.md +++ b/samples/durable-functions/dotnet/LargePayload/README.md @@ -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%" } @@ -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 diff --git a/samples/durable-functions/dotnet/LargePayload/host.json b/samples/durable-functions/dotnet/LargePayload/host.json index 6bb6268b..18080dd2 100644 --- a/samples/durable-functions/dotnet/LargePayload/host.json +++ b/samples/durable-functions/dotnet/LargePayload/host.json @@ -21,7 +21,7 @@ "type": "azureManaged", "connectionStringName": "DTS_CONNECTION_STRING", "payloadStorageEnabled": true, - "payloadStorageThresholdBytes": 900000 + "payloadStorageThresholdBytes": 262144 }, "hubName": "%TASKHUB_NAME%" } diff --git a/samples/durable-functions/dotnet/LargePayloadFanOutFanIn/README.md b/samples/durable-functions/dotnet/LargePayloadFanOutFanIn/README.md index 10c53067..a27eac98 100644 --- a/samples/durable-functions/dotnet/LargePayloadFanOutFanIn/README.md +++ b/samples/durable-functions/dotnet/LargePayloadFanOutFanIn/README.md @@ -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 diff --git a/samples/durable-functions/dotnet/LargePayloadFanOutFanIn/host.json b/samples/durable-functions/dotnet/LargePayloadFanOutFanIn/host.json index ad1d5544..18080dd2 100644 --- a/samples/durable-functions/dotnet/LargePayloadFanOutFanIn/host.json +++ b/samples/durable-functions/dotnet/LargePayloadFanOutFanIn/host.json @@ -20,8 +20,8 @@ "storageProvider": { "type": "azureManaged", "connectionStringName": "DTS_CONNECTION_STRING", - "largePayloadStorageEnabled": true, - "largePayloadStorageThresholdBytes": 900000 + "payloadStorageEnabled": true, + "payloadStorageThresholdBytes": 262144 }, "hubName": "%TASKHUB_NAME%" } From 46fd9f685b4e455180efa480b939d740a3704515 Mon Sep 17 00:00:00 2001 From: Tomer Rosenthal <17064840+torosent@users.noreply.github.com> Date: Wed, 1 Jul 2026 10:23:21 -0700 Subject: [PATCH 3/3] Fix migrate-backend-to-dts skill: correct host.json payload storage keys Rename largePayloadStorage* to the bound payloadStorageEnabled / payloadStorageThresholdBytes keys (per HostJsonOptions in WebJobs.Extensions.DurableTask.AzureManaged) so the migration guidance configures keys the azureManaged provider actually reads. Demo value (10240) unchanged. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --- .github/skills/migrate-backend-to-dts/SKILL.md | 8 ++++---- .github/skills/migrate-backend-to-dts/references/setup.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/skills/migrate-backend-to-dts/SKILL.md b/.github/skills/migrate-backend-to-dts/SKILL.md index b7b9bada..142eea36 100644 --- a/.github/skills/migrate-backend-to-dts/SKILL.md +++ b/.github/skills/migrate-backend-to-dts/SKILL.md @@ -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%" } @@ -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" } diff --git a/.github/skills/migrate-backend-to-dts/references/setup.md b/.github/skills/migrate-backend-to-dts/references/setup.md index 1783ba1b..ea650488 100644 --- a/.github/skills/migrate-backend-to-dts/references/setup.md +++ b/.github/skills/migrate-backend-to-dts/references/setup.md @@ -211,8 +211,8 @@ 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%" } @@ -220,8 +220,8 @@ DTS has a message size limit. For orchestrations that pass large inputs/outputs, } ``` -- **`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`.