Skip to content

Durable Task Scheduler: add health checks and client integration#15928

Open
philliphoff wants to merge 8 commits intomicrosoft:mainfrom
philliphoff:philliphoff-fix-grpc-port
Open

Durable Task Scheduler: add health checks and client integration#15928
philliphoff wants to merge 8 commits intomicrosoft:mainfrom
philliphoff:philliphoff-fix-grpc-port

Conversation

@philliphoff
Copy link
Copy Markdown
Member

@philliphoff philliphoff commented Apr 7, 2026

Description

Adds a new Aspire client integration package for Durable Task Scheduler (Aspire.Microsoft.DurableTask.AzureManaged), along with hosting-side improvements and a standalone worker playground app.

Client integration (Aspire.Microsoft.DurableTask.AzureManaged)

New NuGet package that registers Durable Task workers and/or clients in the DI container for connecting to a Durable Task Scheduler instance. Includes:

  • AddDurableTaskSchedulerWorker / AddKeyedDurableTaskSchedulerWorker — Registers a Durable Task worker (and optionally a DurableTaskClient) with configuration, health checks, and OpenTelemetry tracing.
  • AddDurableTaskSchedulerClient / AddKeyedDurableTaskSchedulerClient — Registers only a DurableTaskClient for starting/managing orchestrations without hosting a worker.
  • DurableTaskSchedulerSettings — Configuration class supporting ConnectionString, DisableHealthChecks, and DisableTracing via the Aspire:Microsoft:DurableTask:AzureManaged configuration section.
  • DurableTaskSchedulerHealthCheck — HTTP-based health check that pings the scheduler's task hub endpoint.
  • ConfigurationSchema.json — JSON schema for IntelliSense support in appsettings.json.
  • README.md — NuGet package documentation with usage examples, configuration options, and AppHost integration guidance.

Hosting-side improvements

  • Added <remarks> and additional <example> XML docs to RunAsEmulator() documenting persistent container lifetime and in-memory state behavior.
  • Added HTTP health check (/healthz) to the emulator container's HTTP endpoint.
  • Updated hosting README with DTS emulator persistence documentation.

Playground app

New DurableTaskWorkerWithDts playground demonstrating a standalone (non-Azure Functions) Durable Task worker using the client integration package with the DTS emulator. Includes a sample chaining orchestrator and activity.

Package dependencies

  • Added Microsoft.DurableTask.Worker.AzureManaged v1.23.3 and Microsoft.DurableTask.Client.AzureManaged v1.23.3 to Directory.Packages.props.

Tests

  • Aspire.Microsoft.DurableTask.AzureManaged.Tests — 42 tests covering:
    • Extension method argument validation and configuration binding
    • Connection string parsing (DurableTaskSchedulerConnectionString)
    • Health check registration and disabling (via config and delegates)
    • Named config override behavior
    • ConfigurationSchema.json validation against valid/invalid JSON

Fixes # (issue)

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

Copilot AI review requested due to automatic review settings April 7, 2026 17:40
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 7, 2026

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15928

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15928"

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Aspire client integration for Durable Task Scheduler (Azure Managed) and improves the hosting-side emulator experience by adding documentation and a container HTTP health check endpoint. It also introduces a standalone playground worker sample and adds the required DurableTask AzureManaged package versions plus a new test project.

Changes:

  • Added new component package Aspire.Microsoft.DurableTask.AzureManaged (DI registration for DTS worker/client, settings binding, health checks, tracing, schema + README).
  • Enhanced DTS emulator hosting integration with additional docs and an HTTP health check (/healthz) on the emulator container.
  • Added DurableTaskWorkerWithDts playground app and a new test project validating config binding, connection string parsing, and schema behavior.

Reviewed changes

Copilot reviewed 24 out of 24 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tests/Aspire.Microsoft.DurableTask.AzureManaged.Tests/DurableTaskSchedulerConnectionStringTests.cs Adds unit tests for parsing endpoint/task hub from DTS connection strings.
tests/Aspire.Microsoft.DurableTask.AzureManaged.Tests/ConfigurationSchemaTests.cs Validates the component’s ConfigurationSchema.json against sample configs.
tests/Aspire.Microsoft.DurableTask.AzureManaged.Tests/AspireDurableTaskSchedulerExtensionsTests.cs Covers extension method validation, config binding, health check toggles, and registration behavior.
tests/Aspire.Microsoft.DurableTask.AzureManaged.Tests/Aspire.Microsoft.DurableTask.AzureManaged.Tests.csproj New test project referencing the component and copying schema to output.
src/Components/Aspire.Microsoft.DurableTask.AzureManaged/README.md New client integration README with usage/config/AppHost guidance.
src/Components/Aspire.Microsoft.DurableTask.AzureManaged/DurableTaskSchedulerSettings.cs Settings model for config binding (ConnectionString, health checks, tracing).
src/Components/Aspire.Microsoft.DurableTask.AzureManaged/DurableTaskSchedulerHealthCheck.cs Implements HTTP-based scheduler ping health check.
src/Components/Aspire.Microsoft.DurableTask.AzureManaged/DurableTaskSchedulerConnectionString.cs Parser utilities used by health check setup.
src/Components/Aspire.Microsoft.DurableTask.AzureManaged/ConfigurationSchema.json Adds appsettings schema for IntelliSense/validation.
src/Components/Aspire.Microsoft.DurableTask.AzureManaged/AssemblyInfo.cs Registers schema + logging categories via assembly attributes.
src/Components/Aspire.Microsoft.DurableTask.AzureManaged/AspireDurableTaskSchedulerExtensions.cs Main registration APIs for DTS worker/client with health checks and OpenTelemetry tracing.
src/Components/Aspire.Microsoft.DurableTask.AzureManaged/Aspire.Microsoft.DurableTask.AzureManaged.csproj New packable component project with DurableTask AzureManaged dependencies.
src/Aspire.Hosting.Azure.Functions/README.md Documents emulator in-memory state + persistent lifetime behavior.
src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskResourceExtensions.cs Adds emulator HTTP health check and expands emulator docs/examples; adds port customization helpers.
playground/DurableTaskWorkerWithDts/DurableTaskWorkerWithDts.Worker/SayHelloActivity.cs Activity sample for standalone DTS worker playground.
playground/DurableTaskWorkerWithDts/DurableTaskWorkerWithDts.Worker/ChainingOrchestrator.cs Orchestrator sample for the playground.
playground/DurableTaskWorkerWithDts/DurableTaskWorkerWithDts.Worker/Program.cs Worker host wiring using the new component registration method.
playground/DurableTaskWorkerWithDts/DurableTaskWorkerWithDts.Worker/DurableTaskWorkerWithDts.Worker.csproj Adds playground worker project referencing the new component.
playground/DurableTaskWorkerWithDts/DurableTaskWorkerWithDts.AppHost/Properties/launchSettings.json Launch profiles for the new playground AppHost.
playground/DurableTaskWorkerWithDts/DurableTaskWorkerWithDts.AppHost/Program.cs AppHost that starts emulator + task hub and references the worker.
playground/DurableTaskWorkerWithDts/DurableTaskWorkerWithDts.AppHost/DurableTaskWorkerWithDts.AppHost.csproj Adds playground AppHost project referencing Azure Functions hosting integration.
playground/AzureFunctionsWithDts/AzureFunctionsWithDts.AppHost/Program.cs Ensures Functions app waits for the DTS task hub resource to be healthy before starting.
Directory.Packages.props Adds pinned versions for DurableTask AzureManaged worker/client packages.
Aspire.slnx Adds new component, test project, and new playground projects to the solution.

Signed-off-by: Phillip Hoff <phillip@orst.edu>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants