Skip to content

Addition of Durable Task Scheduler resources to Azure Functions host library#13711

Open
philliphoff wants to merge 19 commits intodotnet:mainfrom
philliphoff:philliphoff-dts-take-2
Open

Addition of Durable Task Scheduler resources to Azure Functions host library#13711
philliphoff wants to merge 19 commits intodotnet:mainfrom
philliphoff:philliphoff-dts-take-2

Conversation

@philliphoff
Copy link
Contributor

@philliphoff philliphoff commented Dec 30, 2025

Description

Adds resources related to the Durable Task Scheduler to the Azure Functions host library. Allows customers to start the Durable Task Scheduler emulator (or specify a connection string to an existing one) and then pass along connection strings to Azure Functions or other applications.

Replaces #9294 which had languished for too long and a fresh start was needed.

Note that this PR does not cover:

  • Support for DTS in the manifest
  • Support for DTS as part of a deployment
  • Client integration for consuming/configuring DTS

The intent is that these features would be added incrementally as time/demand allows.

Fixes #8926

Checklist

  • Is this feature complete?
    • Yes. Ready to ship. (This PR represents the minimal feature set needed to use DTS with Aspire but more features can be incrementally added as time/demand allow.)
    • 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?
    • Yes
      • Link to aspire-docs issue (consider using one of the following templates):
    • No

@github-actions
Copy link
Contributor

github-actions bot commented Dec 30, 2025

🚀 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/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13711

Or

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

Copy link
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

This PR adds Durable Task Scheduler (DTS) resource support to the Azure Functions hosting library, enabling developers to orchestrate durable functions in their Aspire applications. It replaces the stalled PR #9294 and addresses issue #8926. This is an initial implementation focused on local development and testing scenarios, with manifest support, deployment, and client integrations planned for future work.

Key Changes:

  • Introduces AddDurableTaskScheduler() and AddTaskHub() extension methods for AppHost configuration
  • Supports both emulator mode (RunAsEmulator()) and existing connection strings (RunAsExisting())
  • Provides automatic dashboard URL generation for emulator resources

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 13 comments.

Show a summary per file
File Description
src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskResourceExtensions.cs Extension methods for adding and configuring DTS resources with emulator and existing connection string support
src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskSchedulerResource.cs Core resource class representing a DTS instance with connection string resolution
src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskHubResource.cs Resource class for task hubs that extends scheduler connection strings with hub names
src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskSchedulerEmulatorResource.cs Container resource for running DTS emulator locally
src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskSchedulerConnectionStringAnnotation.cs Annotation for storing existing connection string configuration
src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskHubNameAnnotation.cs Annotation for storing task hub name configuration
src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskSchedulerEmulatorContainerImageTags.cs Constants for DTS emulator container image details
src/Aspire.Hosting.Azure.Functions/README.md Documentation with usage examples for DTS resources including emulator and existing connection scenarios
tests/Aspire.Hosting.Azure.Tests/DurableTaskResourceExtensionsTests.cs Comprehensive test suite covering emulator, existing connections, task hubs, and publish mode behavior
playground/AzureFunctionsWithDts/AzureFunctionsWithDts.AppHost/Program.cs Sample AppHost demonstrating DTS usage with Azure Functions
playground/AzureFunctionsWithDts/AzureFunctionsWithDts.Functions/MyOrchestrationTrigger.cs Sample durable function orchestration with activities
playground/AzureFunctionsWithDts/AzureFunctionsWithDts.Functions/host.json Azure Functions configuration for DTS with hub name and storage provider settings
playground/AzureFunctionsWithDts/AzureFunctionsWithDts.Functions/*.csproj Functions project configuration with DurableTask package references
playground/AzureFunctionsWithDts/AzureFunctionsWithDts.AppHost/*.csproj AppHost project configuration with Azure Functions and Storage package references
Directory.Packages.props Package version additions for DurableTask extensions
Aspire.slnx Solution file update to include new playground project

@mitchdenny
Copy link
Member

@philliphoff should we be using latest for the image tag or would it be better to pin to a specific version and then increment periodically? For things like Postgres we pin to a specific version but for Azure services sometimes the emulators are preferred to always use the latest so the engineering team for the service can ensure people are testing against a version that best represents what is on the service.

@mitchdenny
Copy link
Member

@philliphoff what happens if I do this:

var ts = builder.AddTaskScheduler(...)
var th = builder.AddTaskHub(...)
ts.RunAsEmulator(...)

Do the dashboard links work?

@mitchdenny
Copy link
Member

Lets put the <example> outside the <remarks>

@mitchdenny
Copy link
Member

Once that is done I'm good to see this go in. How do we want to communicate this one to users, this'll probably go out in February at some time, is it worth mentioning at that time on the Azure Functions blogs/channels (will obviously be in our release notes).

@philliphoff
Copy link
Contributor Author

Do the dashboard links work?

@mitchdenny Good catch; it did not. I've fixed it (by deferring the IsEmulator test until the resource ready callback).

@philliphoff
Copy link
Contributor Author

should we be using latest for the image tag or would it be better to pin to a specific version and then increment periodically? For things like Postgres we pin to a specific version but for Azure services sometimes the emulators are preferred to always use the latest so the engineering team for the service can ensure people are testing against a version that best represents what is on the service.

@mitchdenny For better or worse, DTS publishes only the latest tag.

@philliphoff
Copy link
Contributor Author

How do we want to communicate this one to users, this'll probably go out in February at some time, is it worth mentioning at that time on the Azure Functions blogs/channels (will obviously be in our release notes).

@mitchdenny I'll talk to our PMs to see if/how they'd like to communicate the new feature.

@philliphoff
Copy link
Contributor Author

philliphoff commented Jan 26, 2026

@mitchdenny Just a friendly ping; please let me know if there's anything else needed in order for this to get in.

@philliphoff philliphoff requested review from mitchdenny and removed request for captainsafia February 3, 2026 22:17
@philliphoff
Copy link
Contributor Author

philliphoff commented Feb 3, 2026

When this is merged, I should have a quick follow up that adds DTS support for publish and deployment (see work in progress).

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.

Aspire Support for Durable Task Scheduler

3 participants