Skip to content

Latest commit

 

History

History
163 lines (108 loc) · 5.81 KB

quickstart.md

File metadata and controls

163 lines (108 loc) · 5.81 KB

⚡ Quickstart: Your First Durable Orchestration

Get a durable orchestration running locally in under 5 minutes. No Azure subscription needed.

Prerequisites

  • Docker installed and running

Step 1: Start the Emulator

The Durable Task Scheduler emulator runs the full scheduler experience locally in Docker, including a monitoring dashboard.

docker pull mcr.microsoft.com/dts/dts-emulator:latest
docker run -d -p 8080:8080 -p 8082:8082 mcr.microsoft.com/dts/dts-emulator:latest

Verify it's running by opening the dashboard: http://localhost:8082

Step 2: Run a Sample

Choose your language and follow the instructions:

Clone the repository, then open each terminal at the repository root:

git clone https://github.com/Azure-Samples/Durable-Task-Scheduler.git
cd Durable-Task-Scheduler

.NET

Requires: .NET 10 SDK

Start the worker in Terminal 1:

dotnet run --project samples/durable-task-sdks/dotnet/FunctionChaining/Worker

Run the client in Terminal 2:

dotnet run --project samples/durable-task-sdks/dotnet/FunctionChaining/Client

Python

Requires: Python 3.9+

Set up a virtual environment and start the worker in Terminal 1:

cd samples/durable-task-sdks/python/function-chaining
python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
pip install -r requirements.txt
python worker.py

Activate the same virtual environment and run the client in Terminal 2:

cd samples/durable-task-sdks/python/function-chaining
source venv/bin/activate  # Windows: venv\Scripts\activate
python client.py

Java

Requires: Java 21

This sample starts the worker and client in the same process:

cd samples/durable-task-sdks/java/function-chaining
./gradlew runChainingPattern

If the Gradle wrapper is not executable, run chmod +x gradlew first.

JavaScript / TypeScript SDK (preview)

Requires: Node.js 22+. The SDK supports JavaScript and TypeScript; this sample uses JavaScript.

Install dependencies and start the worker in Terminal 1:

cd samples/durable-task-sdks/javascript/function-chaining
npm install
npm run worker

Run the client in Terminal 2:

cd samples/durable-task-sdks/javascript/function-chaining
npm run client

Go

Requires: Go 1.25.0 or later. The samples share one module that uses github.com/microsoft/durabletask-go v1.0.0-beta3.

This sample starts the worker and client in the same process:

cd samples/durable-task-sdks/go
go mod download
go run ./function-chaining

The default connection is Endpoint=http://localhost:8080;TaskHub=default;Authentication=None. If DTS_CONNECTION_STRING is set, unset it first.

Run any of the Go samples with go run ./<sample-name>. Some samples have extra prerequisites; see their READMEs.

Step 3: View in the Dashboard

  1. Open http://localhost:8082 in your browser
  2. Click on the default task hub
  3. You'll see your orchestration instance(s) in the list
  4. Click on an instance to view execution details: each activity, its input/output, and timing

What Just Happened?

You ran a function chaining orchestration, a sequential workflow where:

  1. Activity A processed some input and passed its output to...
  2. Activity B, which transformed it and passed it to...
  3. Activity C, which produced the final result

The orchestration is durable: if the process had crashed at any point, it would have automatically resumed from where it left off.

Connect the Go Samples to Azure

Use an existing scheduler and task hub, or create them with the scheduler setup guide. Give your identity the Durable Task Data Contributor role; see identity-based access. Use a separate task hub for the Go samples. Do not let workers from other SDKs manage the same schedules.

From samples/durable-task-sdks/go:

az login
export DTS_CONNECTION_STRING='Endpoint=https://<scheduler-host>;TaskHub=<hub>;Authentication=DefaultAzure'
go run ./function-chaining

DefaultAzure uses the Azure Identity default credential chain. Use Authentication=AzureCLI to use your CLI sign-in. For managed or workload identity, see the Go SDK connection guide.

Notes:

  • The large-payload and history-export samples use local Azurite for Blob Storage, even when DTS is in Azure. See their READMEs to use Azure Blob Storage.
  • History export needs its own task hub. Export selects instances by completion time, not instance ID, so other work in the hub would be exported too.
  • These steps connect a local Go process to Azure. They do not deploy it. The Go samples have no azd templates.

Next Steps

What to do Link
Explore all patterns Orchestration Patterns Guide
Browse all samples Sample Catalog
Explore the Go SDK Go Samples
Learn about the Durable Task Scheduler Official Documentation
Add OpenTelemetry tracing Observability Guide
Deploy to Azure Azure deployment guide