Addition of Durable Task Scheduler resources to Azure Functions host library#13711
Addition of Durable Task Scheduler resources to Azure Functions host library#13711philliphoff wants to merge 19 commits intodotnet:mainfrom
Conversation
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 13711Or
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 13711" |
There was a problem hiding this comment.
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()andAddTaskHub()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 |
src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskResourceExtensions.cs
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskResourceExtensions.cs
Outdated
Show resolved
Hide resolved
tests/Aspire.Hosting.Azure.Tests/DurableTaskResourceExtensionsTests.cs
Outdated
Show resolved
Hide resolved
playground/AzureFunctionsWithDts/AzureFunctionsWithDts.Functions/Properties/launchSettings.json
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskResourceExtensions.cs
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskSchedulerResource.cs
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskResourceExtensions.cs
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskResourceExtensions.cs
Outdated
Show resolved
Hide resolved
src/Aspire.Hosting.Azure.Functions/DurableTask/DurableTaskResourceExtensions.cs
Outdated
Show resolved
Hide resolved
|
@philliphoff should we be using |
|
@philliphoff what happens if I do this: var ts = builder.AddTaskScheduler(...)
var th = builder.AddTaskHub(...)
ts.RunAsEmulator(...)Do the dashboard links work? |
|
Lets put the |
|
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). |
@mitchdenny Good catch; it did not. I've fixed it (by deferring the |
@mitchdenny For better or worse, DTS publishes only the |
@mitchdenny I'll talk to our PMs to see if/how they'd like to communicate the new feature. |
|
@mitchdenny Just a friendly ping; please let me know if there's anything else needed in order for this to get in. |
|
When this is merged, I should have a quick follow up that adds DTS support for publish and deployment (see work in progress). |
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:
The intent is that these features would be added incrementally as time/demand allows.
Fixes #8926
Checklist
<remarks />and<code />elements on your triple slash comments?