Add Work Item Filters for Functions sample (DTS backend, .NET and Python)#277
Open
bachuv wants to merge 4 commits into
Open
Add Work Item Filters for Functions sample (DTS backend, .NET and Python)#277bachuv wants to merge 4 commits into
bachuv wants to merge 4 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds new Durable Functions samples demonstrating work item filtering when using the Durable Task Scheduler (DTS) backend, including a two-app scenario to show filter isolation and cross-app orchestration scheduling.
Changes:
- Add .NET 8 isolated worker sample apps (App A + App B) with orchestrations, activities, and entities configured for
workItemFilteringEnabled. - Add Python v2 programming model sample apps (App A + App B), including manual extension management via
extensions.csproj. - Update CI workflow to build/install the newly added sample dependencies.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| samples/durable-functions/python/work-item-filtering/test.http | Adds guided HTTP demo steps for the Python sample. |
| samples/durable-functions/python/work-item-filtering/requirements.txt | Adds Python dependencies for the sample. |
| samples/durable-functions/python/work-item-filtering/host.json | Enables workItemFilteringEnabled for the Python sample. |
| samples/durable-functions/python/work-item-filtering/function_app.py | Implements Python orchestrations/activities/entities + HTTP starters. |
| samples/durable-functions/python/work-item-filtering/extensions.csproj | Pins AzureManaged provider packages for manual extension install. |
| samples/durable-functions/python/work-item-filtering/README.md | Documents setup, extension install, and filter behavior for Python sample. |
| samples/durable-functions/python/work-item-filtering-app-b/requirements.txt | Adds Python dependencies for App B. |
| samples/durable-functions/python/work-item-filtering-app-b/host.json | Enables workItemFilteringEnabled for Python App B. |
| samples/durable-functions/python/work-item-filtering-app-b/function_app.py | Implements App B orchestration/activity + HTTP starters. |
| samples/durable-functions/python/work-item-filtering-app-b/extensions.csproj | Pins AzureManaged provider packages for App B manual extension install. |
| samples/durable-functions/python/run-both.ps1 | Runs both Python apps to demonstrate isolation/cross-app scheduling. |
| samples/durable-functions/dotnet/run-both.ps1 | Runs both .NET apps to demonstrate isolation/cross-app scheduling. |
| samples/durable-functions/dotnet/WorkItemFiltering/test.http | Adds guided HTTP demo steps for the .NET sample. |
| samples/durable-functions/dotnet/WorkItemFiltering/host.json | Enables workItemFilteringEnabled for .NET App A. |
| samples/durable-functions/dotnet/WorkItemFiltering/WorkItemFiltering.csproj | Adds .NET 8 isolated worker project and DTS AzureManaged package. |
| samples/durable-functions/dotnet/WorkItemFiltering/README.md | Documents setup and filter behavior for .NET sample. |
| samples/durable-functions/dotnet/WorkItemFiltering/Program.cs | Minimal host bootstrap for .NET sample. |
| samples/durable-functions/dotnet/WorkItemFiltering/Functions.cs | Implements orchestrations/activities/entities + HTTP starters. |
| samples/durable-functions/dotnet/WorkItemFiltering.AppB/host.json | Enables workItemFilteringEnabled for .NET App B. |
| samples/durable-functions/dotnet/WorkItemFiltering.AppB/Program.cs | Minimal host bootstrap for .NET App B. |
| samples/durable-functions/dotnet/WorkItemFiltering.AppB/Functions.cs | Implements App B orchestration/activity + HTTP starter. |
| samples/durable-functions/dotnet/WorkItemFiltering.AppB/AppB.csproj | Adds .NET 8 isolated worker project for App B and dependencies. |
| .github/workflows/build-samples.yml | Adds CI steps to build/install the new samples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Adds samples demonstrating the work item filtering feature for Durable Functions with the Durable Task Scheduler backend. When multiple Function apps share the same task hub, work item filtering ensures each app only receives work items for the functions it has registered, preventing dispatch failures.
Each sample is shipped as a pair of apps so the multi-worker filtering behavior is demonstrable end-to-end:
samples/durable-functions/dotnet/WorkItemFiltering/+WorkItemFiltering.AppB/) — .NET 8 isolated worker. App A registersgreeting, fan-out, sub-orchestration, and entity functions; App B registers anordersorchestration with aship_orderactivity. Both target the same task hub.samples/durable-functions/python/work-item-filtering/+work-item-filtering-app-b/) — Python v2 programming model, same pattern. Uses a manualextensions.csproj(installed viafunc extensions install) to pinMicrosoft.Azure.WebJobs.Extensions.DurableTask.AzureManaged 1.8.1instead of the public extension bundle.A
run-both.ps1script in each language folder builds both apps, launches them on ports 7071/7072, and runs five scenarios to validate filter routing (own-app, cross-app A→B, cross-app B→A, and unknown-orchestration-stays-Pending).Also updates
.github/workflows/build-samples.ymlwith build steps for the new projects.Does this introduce a breaking change?
Pull Request Type
How to Test
Get the code:
Start DTS emulator + Azurite (one-time):
Run the .NET split-worker demo:
Run the Python split-worker demo:
Both scripts print a 5-row table; rows 1–4 should be
Completed, row 5 should stayPending.What to Check
WorkItemFiltering,WorkItemFiltering.AppB) build cleanlyfunc extensions installrun-both.ps1(in both languages) prints 4×Completed+ 1×PendingMicrosoft.DurableTask: Informationlog line"Work item filtering enabled. Registered N orchestrators..."appears in each host's startup loghost.jsonincludes"workItemFilteringEnabled": trueunderstorageProviderin all four appsbuild-samples.ymlsucceed for the new projectsOther Information
Samples consume the publicly released
Microsoft.Azure.Functions.Worker.Extensions.DurableTask.AzureManaged 1.8.1(.NET) andMicrosoft.Azure.WebJobs.Extensions.DurableTask.AzureManaged 1.8.1(Python) packages from nuget.org.