Skip to content

Add Work Item Filters for Functions sample (.NET and Python)#277

Draft
bachuv wants to merge 1 commit intoAzure-Samples:mainfrom
bachuv:vabachu/work-item-filters-functions
Draft

Add Work Item Filters for Functions sample (.NET and Python)#277
bachuv wants to merge 1 commit intoAzure-Samples:mainfrom
bachuv:vabachu/work-item-filters-functions

Conversation

@bachuv
Copy link
Copy Markdown

@bachuv bachuv commented Apr 28, 2026

Note: draft PR until the feature is released.

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.

Two samples added:

  • .NET (samples/durable-functions/dotnet/WorkItemFiltering/) — .NET 8 isolated worker with orchestrations, activities, entities, sub-orchestrations, and fan-out/fan-in
  • Python (samples/durable-functions/python/work-item-filtering/) — Python v2 programming model with the same patterns

Both include a test.http file with a guided demo workflow and a README.md following the repo's sample template.

Does this introduce a breaking change?

[ ] Yes
[x] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[ ] Other... Please describe:

How to Test

  • Get the code
git clone https://github.com/bachuv/Durable-Task-Scheduler.git
cd Durable-Task-Scheduler
git checkout vabachu/work-item-filters-functions
  • Test the .NET sample
# Start DTS emulator + Azurite
docker run --name dtsemulator -d -p 8080:8080 -p 8082:8082 mcr.microsoft.com/dts/dts-emulator:latest
docker run --name azurite -d -p 10000:10000 -p 10001:10001 -p 10002:10002 mcr.microsoft.com/azure-storage/azurite

# Run the .NET sample
cd samples/durable-functions/dotnet/WorkItemFiltering
func start
  • Test the Python sample
cd samples/durable-functions/python/work-item-filtering
python -m venv .venv
source .venv/bin/activate  # or .venv\Scripts\activate on Windows
pip install -r requirements.txt
func start

What to Check

Verify that the following are valid

  • .NET sample builds and starts with func start
  • Python sample starts with func start after installing requirements
  • test.http files have correct URLs and expected results documented
  • README.md files follow the repo's sample template structure
  • host.json includes "workItemFilteringEnabled": true under storageProvider
  • Both samples include orchestrations, activities, entities, and a generic starter for testing filter isolation

Other Information

These samples depend on the work item filtering feature which is currently being added via companion PRs in azure-functions-durable-extension and the DTS backend SDK. The samples will work once those changes ship in published NuGet packages.

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.

1 participant