-
Notifications
You must be signed in to change notification settings - Fork 163
Description
Description
Durable Task Scheduler (DTS) is a new Azure service (currently in public preview) for applications built on Durable Task, both as part of Azure Durable Functions as well as stand-alone compute. Developers with DTS dependencies may wish to orchestrate the startup of and/or connection strings related to DTS instances as part of their overall .NET Aspire application. In particular, orchestrating the startup of a DTS emulator instance for local development.
Proposed Solution
Add a CommunityToolkit.Aspire.Hosting.DurableTask host integration library. This library would enable use of DTS (via emulator) as shown:
var builder = DistributedApplication.CreateBuilder(args);
var scheduler = builder.AddDurableTaskScheduler("scheduler")
.RunAsEmulator();
var taskHub = scheduler.AddDurableTaskHub("taskhub");
builder.AddProject<Projects.MyApp>("myapp")
.WithReference(taskHub);
builder.Build().Run();The scheduler and task hub resources will generate and propagate appropriate connection strings, as well as expose properties for customization (e.g. scheduler and task hubs with names that differ from their respective resource names, authentication mechanism, emulator options, etc). When using the emulator, commands will be automatically added to the resources so developers can easily open the DTS dashboard from the .NET Aspire dashboard.
For existing (Azure) DTS instances, connection strings can be passed through parameters:
var builder = DistributedApplication.CreateBuilder(args);
var scheduler =
builder.AddDurableTaskScheduler("scheduler")
.RunAsExisting(builder.AddParameter("scheduler-connection-string"));
var taskHub =
scheduler.AddTaskHub("taskhub")
.WithTaskHubName(builder.AddParameter("taskhub-name"));
builder.AddProject<Projects.MyApp>("myapp")
.WithReference(taskHub);
builder.Build().Run();Note: deployment of DTS instances based on the application model is a PR for another day.
Existing Work
This integration work has been started here:
https://github.com/philliphoff/CommunityToolkit.Aspire/tree/philliphoff-dts-integration
- Host project added
- Samples added
- Unit tests added
- Integration tests added
- Tests added to the CI pipeline
- Community Toolkit docs updated
- .NET Aspire docs updated
- NuGet Packaging properties added