From 5be45eed42d2b387dc8c61df53b27ec5905f5871 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 2 Jun 2026 02:39:09 +0000 Subject: [PATCH 1/3] Initial plan From 5aceba700566d186d388ca945eec23d651e0dea1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 2 Jun 2026 02:48:53 +0000 Subject: [PATCH 2/3] Add Durable Task Scheduler client integration docs Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com> --- .../azure-functions-connect.mdx | 101 ++++++++++++++++++ .../azure-functions/azure-functions-host.mdx | 2 + 2 files changed, 103 insertions(+) diff --git a/src/frontend/src/content/docs/integrations/cloud/azure/azure-functions/azure-functions-connect.mdx b/src/frontend/src/content/docs/integrations/cloud/azure/azure-functions/azure-functions-connect.mdx index 38a6b7951..b4bb68ffa 100644 --- a/src/frontend/src/content/docs/integrations/cloud/azure/azure-functions/azure-functions-connect.mdx +++ b/src/frontend/src/content/docs/integrations/cloud/azure/azure-functions/azure-functions-connect.mdx @@ -5,6 +5,7 @@ description: Learn how Azure Functions code reads Aspire-injected environment va import { Image } from 'astro:assets'; import { Aside, Tabs, TabItem } from '@astrojs/starlight/components'; +import InstallDotNetPackage from '@components/InstallDotNetPackage.astro'; import functionsIcon from '@assets/icons/azure-functionapps-icon.png'; +## Durable Task Scheduler client integration + +For Durable Functions workloads that use [Durable Task Scheduler](https://learn.microsoft.com/azure/azure-functions/durable/durable-task-scheduler/durable-task-scheduler), use the Aspire client integration package to register workers and clients with health checks and OpenTelemetry tracing. + + + +### Minimal end-to-end setup + +Add a Durable Task Scheduler resource and task hub in your AppHost, then reference the task hub from your worker project: + +```csharp title="C# — AppHost.cs" +#pragma warning disable ASPIREDURABLETASK001 + +var builder = DistributedApplication.CreateBuilder(args); + +var scheduler = builder.AddDurableTaskScheduler("scheduler") + .RunAsEmulator(); + +var taskHub = scheduler.AddTaskHub("taskhub"); + +builder.AddProject("worker") + .WithReference(taskHub); + +builder.Build().Run(); + +#pragma warning restore ASPIREDURABLETASK001 +``` + +In your worker project's _Program.cs_, call `AddDurableTaskSchedulerWorker` to register a worker and (by default) a `DurableTaskClient`: + +```csharp title="C# — Program.cs" +builder.AddDurableTaskSchedulerWorker("taskhub", worker => +{ + worker.AddTasks(tasks => + { + tasks.AddOrchestrator(); + tasks.AddActivity(); + }); +}); +``` + +If your app only needs to start and manage orchestrations (without hosting a worker), use `AddDurableTaskSchedulerClient`: + +```csharp title="C# — Program.cs" +builder.AddDurableTaskSchedulerClient("taskhub"); +``` + +### Keyed registrations + +Use keyed registrations when you need multiple scheduler connections in one app: + +```csharp title="C# — Program.cs" +builder.AddKeyedDurableTaskSchedulerWorker("orders", worker => +{ + worker.AddTasks(tasks => tasks.AddOrchestrator()); +}); + +builder.AddKeyedDurableTaskSchedulerClient("billing"); +``` + +### Configuration + +The package reads `DurableTaskSchedulerSettings` from `Aspire:Microsoft:DurableTask:AzureManaged`. For keyed registrations, named settings at `Aspire:Microsoft:DurableTask:AzureManaged:{name}` override the top-level settings. + +#### Connection strings + +`AddDurableTaskSchedulerWorker` and `AddDurableTaskSchedulerClient` read connection strings from `ConnectionStrings:{connectionName}`: + +```json title="JSON — appsettings.json" +{ + "ConnectionStrings": { + "taskhub": "Endpoint=https://my-scheduler.durabletask.io;Authentication=DefaultAzure;TaskHub=MyHub" + } +} +``` + +#### Configuration providers + +You can also configure settings from configuration providers: + +```json title="JSON — appsettings.json" +{ + "Aspire": { + "Microsoft": { + "DurableTask": { + "AzureManaged": { + "ConnectionString": "Endpoint=https://my-scheduler.durabletask.io;Authentication=DefaultAzure;TaskHub=MyHub", + "DisableHealthChecks": false, + "DisableTracing": false + } + } + } + } +} +``` + +### Health checks and telemetry + +By default, the integration adds a Durable Task Scheduler health check and OpenTelemetry tracing for `Microsoft.DurableTask` sources. Set `DisableHealthChecks` or `DisableTracing` to `true` in `DurableTaskSchedulerSettings` (or via code) to disable either feature. + ## local.settings.json for local development without Aspire When running your Azure Functions project outside of Aspire (for example, in isolation with `func start`), the Functions runtime reads connection information from `local.settings.json`. You can populate this file with the same environment variable names that Aspire injects: diff --git a/src/frontend/src/content/docs/integrations/cloud/azure/azure-functions/azure-functions-host.mdx b/src/frontend/src/content/docs/integrations/cloud/azure/azure-functions/azure-functions-host.mdx index 360917f9b..05dbb162f 100644 --- a/src/frontend/src/content/docs/integrations/cloud/azure/azure-functions/azure-functions-host.mdx +++ b/src/frontend/src/content/docs/integrations/cloud/azure/azure-functions/azure-functions-host.mdx @@ -442,6 +442,8 @@ builder.Build().Run(); Durable Task Scheduler deployment support (manifest and deployment) is not yet included. Only local development with the emulator or an existing scheduler instance is currently supported. +For worker and client registrations in your consuming app (for example, `AddDurableTaskSchedulerWorker` and `AddDurableTaskSchedulerClient`), see [Azure Functions runtime configuration](../azure-functions-connect/#durable-task-scheduler-client-integration). + ## Deployment Deployment to Azure Container Apps (ACA) is supported using the SDK container publish function in `Microsoft.Azure.Functions.Worker.Sdk`. When deploying to Azure Container Apps, KEDA-based auto-scaling rules are automatically configured for your functions. From 6dc9973e20f7b4148c95fa8fa11d0a72ba1e9b2b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 2 Jun 2026 02:50:59 +0000 Subject: [PATCH 3/3] Document Durable Task Scheduler client integration Co-authored-by: IEvangelist <7679720+IEvangelist@users.noreply.github.com> --- .../azure/azure-functions/azure-functions-connect.mdx | 7 +++++++ .../cloud/azure/azure-functions/azure-functions-host.mdx | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/content/docs/integrations/cloud/azure/azure-functions/azure-functions-connect.mdx b/src/frontend/src/content/docs/integrations/cloud/azure/azure-functions/azure-functions-connect.mdx index b4bb68ffa..29e52687b 100644 --- a/src/frontend/src/content/docs/integrations/cloud/azure/azure-functions/azure-functions-connect.mdx +++ b/src/frontend/src/content/docs/integrations/cloud/azure/azure-functions/azure-functions-connect.mdx @@ -231,6 +231,7 @@ def my_queue_function(msg: func.ServiceBusMessage): ## Durable Task Scheduler client integration For Durable Functions workloads that use [Durable Task Scheduler](https://learn.microsoft.com/azure/azure-functions/durable/durable-task-scheduler/durable-task-scheduler), use the Aspire client integration package to register workers and clients with health checks and OpenTelemetry tracing. +Use this integration when your app directly hosts Durable Task workers or clients outside the Azure Functions runtime process; for AppHost scheduler and task hub resource setup, continue to use the hosting APIs documented in [Set up Azure Functions in the AppHost](../azure-functions-host/#durable-task-scheduler-integration). @@ -238,6 +239,10 @@ For Durable Functions workloads that use [Durable Task Scheduler](https://learn. Add a Durable Task Scheduler resource and task hub in your AppHost, then reference the task hub from your worker project: +:::note +The AppHost snippet uses a pragma to suppress `ASPIREDURABLETASK001` because the Durable Task Scheduler hosting APIs are currently marked as experimental. +::: + ```csharp title="C# — AppHost.cs" #pragma warning disable ASPIREDURABLETASK001 @@ -269,6 +274,8 @@ builder.AddDurableTaskSchedulerWorker("taskhub", worker => }); ``` +The connection name (`"taskhub"`) must match the task hub resource name from the AppHost. + If your app only needs to start and manage orchestrations (without hosting a worker), use `AddDurableTaskSchedulerClient`: ```csharp title="C# — Program.cs" diff --git a/src/frontend/src/content/docs/integrations/cloud/azure/azure-functions/azure-functions-host.mdx b/src/frontend/src/content/docs/integrations/cloud/azure/azure-functions/azure-functions-host.mdx index 05dbb162f..de485afa5 100644 --- a/src/frontend/src/content/docs/integrations/cloud/azure/azure-functions/azure-functions-host.mdx +++ b/src/frontend/src/content/docs/integrations/cloud/azure/azure-functions/azure-functions-host.mdx @@ -442,7 +442,7 @@ builder.Build().Run(); Durable Task Scheduler deployment support (manifest and deployment) is not yet included. Only local development with the emulator or an existing scheduler instance is currently supported. -For worker and client registrations in your consuming app (for example, `AddDurableTaskSchedulerWorker` and `AddDurableTaskSchedulerClient`), see [Azure Functions runtime configuration](../azure-functions-connect/#durable-task-scheduler-client-integration). +For worker and client registration APIs in your consuming app (for example, `AddDurableTaskSchedulerWorker` and `AddDurableTaskSchedulerClient`), see [Azure Functions runtime configuration](../azure-functions-connect/#durable-task-scheduler-client-integration). ## Deployment