Add durable task example - #59
Open
madebygps wants to merge 9 commits into
Open
Conversation
- Add agent_durabletask.py with minimal worker-client hosted agent - Add Spanish translation - Add dts-emulator service to devcontainer docker-compose - Add agent-framework-durabletask dependency - Update AGENTS.md test plan
Add optional Azure DTS deployment (behind DEPLOY_DTS flag) so the agent_durabletask example can run against a real DTS scheduler instead of only the local emulator. Infrastructure: - infra/dts.bicep: scheduler + task hub + RBAC (Durable Task Data Contributor) - main.bicep: conditional module call gated by deployDts param - main.parameters.json, write_dot_env.sh/.ps1: wire DTS_ENDPOINT/DTS_TASKHUB Example updates: - Rework agent_durabletask.py into a realistic IT support scenario that naturally motivates the worker restart (user leaves to reboot laptop) - Use sync DefaultAzureCredential for DTS SDK, async for OpenAI client - Align with repo conventions: module-level client/agent setup, async main(), gpt-5.4 default, no unnecessary abstractions - Update Spanish translation to match Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Add agent_durabletask.py to the examples table - Add optional DTS emulator Docker step under local environment setup - Add 'Deploying the Durable Task Scheduler' section with azd env set DEPLOY_DTS instructions - Update both English and Spanish READMEs Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Match the pattern used by REDIS_URL and OTEL — active local defaults that azd provision overwrites with the Azure endpoint. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The earlier DTS commit accidentally replaced the AZURE_SEARCH_KNOWLEDGE_BASE_NAME and AZURE_AI_PROJECT lines instead of appending. Restore them and fix stray blank line and missing trailing newline. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new Durable Task Scheduler (DTS) persistence demo and supporting local/devcontainer/Azure provisioning guidance so users can see agent session state survive worker restarts.
Changes:
- Added new DTS demo scripts in English and Spanish (
examples/agent_durabletask.py,examples/spanish/agent_durabletask.py). - Added optional Azure infrastructure for DTS (
infra/dts.bicep) and wiring ininfra/main.bicep+ parameterization. - Updated devcontainer, env templates, and docs (README/AGENTS + Spanish README) to run the DTS emulator locally and deploy DTS in Azure.
Show a summary per file
| File | Description |
|---|---|
pyproject.toml |
Adds agent-framework-durabletask dependency for the new demos. |
infra/write_dot_env.sh |
Writes DTS outputs into .env after provisioning. |
infra/write_dot_env.ps1 |
Same as above for Windows postprovision hook. |
infra/main.parameters.json |
Adds deployDts parameter wired from DEPLOY_DTS. |
infra/main.bicep |
Optionally provisions DTS and outputs DTS_ENDPOINT/DTS_TASKHUB. |
infra/dts.bicep |
New module provisioning a scheduler + task hub + RBAC. |
examples/agent_durabletask.py |
New English DTS persistence demo script. |
examples/spanish/agent_durabletask.py |
New Spanish DTS persistence demo script. |
README.md |
Documents running emulator locally and deploying DTS for the demo. |
examples/spanish/README.md |
Spanish documentation for emulator + Azure DTS deployment for the demo. |
AGENTS.md |
Adds DTS requirements section and example listing. |
.env.sample |
Adds DTS env vars for configuring the demo. |
.devcontainer/docker-compose.yml |
Adds dts-emulator service and sets DTS_ENDPOINT for the app container. |
.devcontainer/devcontainer.json |
Forwards DTS dashboard port in devcontainer. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 14/15 changed files
- Comments generated: 7
- Use 'or' pattern for DTS_ENDPOINT/DTS_TASKHUB to treat empty strings as missing (both EN and ES examples) - Parameterize ipAllowlist in dts.bicep (default: 0.0.0.0/0 for demo) - Guard DTS vars in write_dot_env.sh/.ps1 so empty values aren't written when DTS isn't deployed - Clarify .env.sample comment about devcontainer vs host endpoints Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
DTS Integration and Demo Examples
examples/agent_durabletask.pyandexamples/spanish/agent_durabletask.pyas demos showing how agent state persists across worker restarts using Durable Task Scheduler, with clear instructions and both English and Spanish versions. [1] [2]README.md,AGENTS.md, andexamples/spanish/README.mdto document how to run the DTS emulator locally, deploy to Azure, and run the new DTS demo, including instructions and links to dashboards. [1] [2] [3] [4] [5] [6]Development Environment Enhancements
.devcontainer/docker-compose.ymlto add adts-emulatorservice, expose necessary ports, and set theDTS_ENDPOINTenvironment variable for the app service. [1] [2].devcontainer/devcontainer.jsonto forward DTS emulator ports (8080 and 8082) into the container for local development and dashboard access.Configuration and Infrastructure
.env.samplewithDTS_ENDPOINTandDTS_TASKHUBvariables to support local and Azure DTS configuration.infra/dts.bicepto provision Azure Durable Task Scheduler and Task Hub resources, including RBAC assignment, for cloud deployment scenarios.