Repository navigation
Python: Migrate Foundry Toolbox sample to unified azure.yaml - #9560
John Miller (therealjohn) wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Template exclusions and initialization guidance prevent the documented setup paths from working correctly.
3 open issues
What changed in this PR
Migrates the Python Foundry Toolbox sample to a unified azure.yaml, keeping deployment configuration within Agent Framework.
Changes:
- Declares the project, model, connections, toolbox, and hosted agent with dependency ordering.
- Updates initialization, authentication, deployment, and local-run guidance.
- Adds eight offline configuration tests and expands file exclusions.
| File | Description |
|---|---|
toolbox.yaml |
Removes the standalone toolbox definition. |
tests/test_configuration.py |
Adds configuration and documentation checks. |
README.md |
Documents the unified deployment workflow. |
azure.yaml |
Defines services, dependencies, authentication, and endpoint bindings. |
agent.yaml |
Removes the legacy hosted-agent definition. |
agent.manifest.yaml |
Removes the legacy initialization manifest. |
.env.example |
Updates local runtime settings. |
.dockerignore |
Excludes local state and tests from container builds. |
.azdignore |
Revises template file exclusions. |
Review effort: Balanced
| azure.yaml | ||
| .env.example |
There was a problem hiding this comment.
Fixed in 03ddda6: removed azure.yaml and .env.example from .azdignore so azd template adoption pulls them down.
| For a repository checkout, work from this sample directory and use the CLI's local-code setup | ||
| (`azd ai agent init --src .`) rather than adopting a second manifest over the existing `azure.yaml`. |
There was a problem hiding this comment.
Fixed in 03ddda6: the repository checkout path now uses azd ai agent init . and accepts reuse of the existing configuration.
| After init, confirm the project managed identity has **Cognitive Services Language Owner** on the | ||
| Language resource before deploying. See the |
There was a problem hiding this comment.
Fixed in 03ddda6: the README now documents azd provision, granting the Language role to the new project identity, then azd deploy --all for new projects; existing projects grant after init and before azd up.

Motivation & Context
The Foundry Toolbox sample still initializes from a legacy manifest in another repository. Current Foundry CLI template adoption requires a unified
azure.yaml, and local hosting alone does not create the authenticated connections or toolbox.Keep this Agent Framework sample independently runnable and deployable by migrating its configuration and dependency graph, rather than deleting the legacy manifests without replacements.
Description & Review Guide
agent.manifest.yaml,agent.yaml, and the standalonetoolbox.yamlwith a unified project containing the Foundry project/model, three authenticated connections, six-tool toolbox, and hosted agent. Preserve the agent name, metadata,gpt-4.1model, Responses 2.0 protocol, and CPU/memory limits. Declare dependency ordering and map the versioned toolbox output toTOOLBOX_ENDPOINT.azure.yaml, prepare PAT/Language/Foundry access before init, deploy dependencies before local use, and update all services withazd deploy --all. The README describes the actual flat project/source layout, the existing-model workaround in [Issue] Template adoption does not offer existing Foundry model deployments Azure/azure-dev#10519, and a Toolkit path that does not rely on legacy gallery manifests. Exclude local environment state from deployment contexts.main.pyis unchanged, preserving request-owned resources, async cleanup, platform headers/identity, andhistory_source="agent_server".python -m pytest python\samples\04-hosting\foundry-hosted-agents\responses\foundry_toolbox\tests -q --confcutdir=python\samples\04-hosting\foundry-hosted-agents\responses\foundry_toolbox.python -m ruff check python\samples\04-hosting\foundry-hosted-agents\responses\foundry_toolbox\testsandpython -m ruff format --check python\samples\04-hosting\foundry-hosted-agents\responses\foundry_toolbox\testspass. The current azd root and all six service schemas validate, local README links resolve, and 18 external Markdown links return HTTP 200. No Azure deployment or live authentication/tool invocation was performed. The existingpython -m pytest python\tests\samples\hosting\test_toolbox_endpoint.py -q --confcutdir=python\tests\samples\hostingfails during collection because its unchanged loader references the nonexistentresponses/04_foundry_toolbox/main.py.Related Issue
No agreed Agent Framework issue was supplied or found in the targeted open-issue search. Maintainer agreement is not verified. Related external issue: Azure/azure-dev#10519, which this migration documents a workaround for but does not fix. No competing open PR was found in the targeted
toolbox azure.yamlsearch.AI Assistance
AI assistance details: Copilot assisted with configuration migration, offline regression tests, README updates, validation, and this PR description. This draft is opened for the contributor to review. The contributor has not yet completed the personal review and attestation required by AI_CONTRIBUTIONS.md; it must be completed before marking this PR ready for review.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.