This sample demonstrates worker-level versioning, where each worker deployment is associated with a single version string.
- The worker uses
UseVersioning(...)withMatchStrategy = Strictto pin itself to a single version and reject orchestration instances stamped with a different version. - The client uses
UseDefaultVersion()to stamp every new orchestration instance with the same version automatically. - The orchestration reads
context.Versionto see what version it was scheduled with. - To "upgrade," you redeploy the worker with a new implementation and change the version string.
- .NET 10.0 SDK
- Docker
docker run --name durabletask-emulator -d -p 8080:8080 -e ASPNETCORE_URLS=http://+:8080 mcr.microsoft.com/dts/dts-emulator:latestexport DURABLE_TASK_SCHEDULER_CONNECTION_STRING="Endpoint=http://localhost:8080;TaskHub=default;Authentication=None"PowerShell:
$env:DURABLE_TASK_SCHEDULER_CONNECTION_STRING = "Endpoint=http://localhost:8080;TaskHub=default;Authentication=None"dotnet runBash:
WORKER_VERSION=2.0 dotnet runPowerShell:
$env:WORKER_VERSION = "2.0"; dotnet rundocker rm -f durabletask-emulatorWorker-level versioning is the simplest model. Use it when:
- You deploy one version of your orchestration logic at a time
- You want a straightforward rolling upgrade story
- You don't need multiple versions of the same orchestration active simultaneously
For running multiple versions of the same orchestration in one worker, see the EternalOrchestrationVersionMigrationSample.