Skip to content

Python: [Python/.NET] Normalize Foundry sample configuration - #9070

Merged
Eduard van Valkenburg (eavanvalkenburg) merged 5 commits into
mainfrom
urban-journey
Oct 6, 2026
Merged

Eduard van Valkenburg (eavanvalkenburg) merged 5 commits into
mainfrom
urban-journey

Conversation

@eavanvalkenburg

Copy link
Copy Markdown
Member

Motivation & Context

Agent Framework samples and guidance used a mix of account-root Foundry URLs, project-scoped URLs, and legacy environment-variable names. This made otherwise equivalent Python and .NET samples require different configuration and could direct users to an invalid project endpoint.

Description & Review Guide

  • What are the major changes?
    • Use project-scoped Foundry endpoints with /api/projects/<project> throughout affected samples and READMEs.
    • Prefer FOUNDRY_PROJECT_ENDPOINT, FOUNDRY_MODEL, and FOUNDRY_EMBEDDING_MODEL in sample-facing configuration.
    • Keep the azd-managed AZURE_AI_MODEL_DEPLOYMENT_NAME contract in hosted-agent manifests and use it only as a runtime compatibility fallback.
    • Align sample verification metadata and workflows with the variables consumed by the samples.
  • What is the impact of these changes?
    • Local sample setup is consistent across Python and .NET without changing public APIs.
    • Existing hosted-agent deployments remain compatible with the azd-managed model variable.
  • What do you want reviewers to focus on?
    • The boundary between user-facing FOUNDRY_* configuration and the retained azd-managed hosted-agent variable.
    • The sample-verifier and workflow updates that accompany the sample changes.

Related Issue

N/A

Contribution Checklist

  • The code builds clean without any errors or warnings
  • All unit tests pass, and I have added new tests where possible
  • The PR follows the Contribution Guidelines
  • This PR is linked to an issue and there is no other open PR for this issue (see Related Issue above).
  • This is not a breaking change. If it is a breaking change, add the breaking change label (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.

@agent-framework-automation agent-framework-automation Bot added documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs python Usage: [Issues, PRs], Target: Python .NET Usage: [Issues, PRs], Target: .Net workflows Usage: [Issues, PRs], Target: Workflows labels Oct 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Several affected samples still expose or prioritize legacy configuration names, leaving the cross-language contract inconsistent.

Review effort: Balanced
Findings: 3 Medium severity · 1 Low severity

Open (4)
What changed in this PR

Normalizes Microsoft Foundry endpoint and model configuration across Python and .NET samples while preserving hosted-agent compatibility.

Changes:

  • Standardizes project-scoped endpoints and FOUNDRY_* variables.
  • Adds hosted Python model-variable fallbacks.
  • Aligns sample verification metadata and CI environments.
File Description
README.md Updates .NET configuration names.
python/​scripts/​sample_validation/​skills/​foundry-hosted-agent-validation/​SKILL.md Documents local and hosted model variables.
python/​samples/​SAMPLE_GUIDELINES.md Corrects the endpoint example.
python/​samples/​05-end-to-end/​evaluation/​self_reflection/​README.md Uses a project-scoped endpoint.
python/​samples/​05-end-to-end/​evaluation/​self_reflection/​.env.example Updates the endpoint template.
python/​samples/​04-hosting/​mcp/​README.md Updates Foundry setup.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​workflows/​main.py Adds model-variable fallback.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​workflows/​.env.example Uses FOUNDRY_MODEL.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​tools/​main.py Adds model-variable fallback.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​tools/​.env.example Uses FOUNDRY_MODEL.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​steerable_long_running_agent/​main.py Normalizes model configuration.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​steerable_long_running_agent/​.env.example Uses FOUNDRY_MODEL.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​resilient_long_running_workflow/​.env.example Uses FOUNDRY_MODEL.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​observability/​main.py Adds model-variable fallback.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​observability/​.env.example Uses FOUNDRY_MODEL.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​monty_codeact/​main.py Adds model-variable fallback.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​mcp/​main.py Adds model-variable fallback.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​mcp/​.env.example Uses FOUNDRY_MODEL.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​foundry_toolbox/​main.py Adds model-variable fallback.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​foundry_toolbox/​.env.example Uses FOUNDRY_MODEL.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​foundry_toolbox_mcp_skills/​README.md Updates required variables.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​foundry_toolbox_mcp_skills/​main.py Adds model-variable fallback.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​foundry_toolbox_mcp_skills/​.env.example Uses FOUNDRY_MODEL.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​foundry_memory/​README.md Normalizes model variables.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​foundry_memory/​provision_memory_store.py Normalizes provisioning configuration.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​foundry_memory/​main.py Adds model-variable fallback.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​foundry_memory/​.env.example Updates chat and embedding variables.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​files/​README.md Updates required variables.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​files/​main.py Adds model-variable fallback.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​files/​.env.example Uses FOUNDRY_MODEL.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​declarative_customer_support/​main.py Adds model-variable fallback.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​declarative_customer_support/​.env.example Uses FOUNDRY_MODEL.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​custom_storage/​README.md Updates required variables.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​custom_storage/​main.py Adds model-variable fallback.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​custom_storage/​.env.example Uses FOUNDRY_MODEL.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​basic/​service_history.py Adds model-variable fallback.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​basic/​README.md Updates local configuration.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​basic/​provider_background.py Adds model-variable fallback.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​basic/​options.py Adds model-variable fallback.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​basic/​main.py Adds model-variable fallback.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​basic/​agent_history.py Adds model-variable fallback.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​basic/​.env.example Uses FOUNDRY_MODEL.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​azure_search_rag/​main.py Adds model-variable fallback.
python/​samples/​04-hosting/​foundry-hosted-agents/​responses/​azure_search_rag/​.env.example Uses FOUNDRY_MODEL.
python/​samples/​04-hosting/​foundry-hosted-agents/​README.md Documents local and hosted contracts.
python/​samples/​04-hosting/​foundry-hosted-agents/​invocations/​telegram/​tests/​test_main.py Updates test configuration.
python/​samples/​04-hosting/​foundry-hosted-agents/​invocations/​telegram/​main.py Adds model-variable fallback.
python/​samples/​04-hosting/​foundry-hosted-agents/​invocations/​telegram/​deploy.sh Removes obsolete endpoint variable.
python/​samples/​04-hosting/​foundry-hosted-agents/​invocations/​telegram/​azure.yaml Uses the normalized endpoint.
python/​samples/​04-hosting/​foundry-hosted-agents/​invocations/​telegram/​.env.example Uses FOUNDRY_MODEL.
python/​samples/​04-hosting/​foundry-hosted-agents/​invocations/​break_glass/​main.py Adds model-variable fallback.
python/​samples/​04-hosting/​foundry-hosted-agents/​invocations/​break_glass/​.env.example Uses FOUNDRY_MODEL.
python/​samples/​04-hosting/​foundry-hosted-agents/​invocations/​basic/​main.py Adds model-variable fallback.
python/​samples/​04-hosting/​foundry-hosted-agents/​invocations/​basic/​.env.example Uses FOUNDRY_MODEL.
python/​samples/​04-hosting/​container/​hyperlight_codeact/​main.py Adds model-variable fallback.
python/​samples/​04-hosting/​container/​hyperlight_codeact/​.env.example Uses FOUNDRY_MODEL.
python/​samples/​04-hosting/​af-hosting/​local_telegram/​README.md Corrects endpoint guidance.
python/​samples/​04-hosting/​af-hosting/​local_responses/​README.md Corrects endpoint guidance.
python/​samples/​04-hosting/​af-hosting/​local_responses/​app.py Corrects embedded setup instructions.
python/​samples/​04-hosting/​af-hosting/​local_responses_workflow/​README.md Corrects endpoint guidance.
python/​samples/​04-hosting/​af-hosting/​local_responses_workflow/​app.py Corrects embedded setup instructions.
python/​samples/​04-hosting/​af-hosting/​local_responses_harness/​README.md Corrects endpoint guidance.
python/​samples/​04-hosting/​af-hosting/​local_responses_harness/​app.py Corrects embedded setup instructions.
python/​samples/​02-agents/​providers/​foundry/​foundry_agent_basic.py Corrects the endpoint example.
python/​samples/​02-agents/​observability/​README.md Corrects the endpoint example.
python/​samples/​02-agents/​multimodal_input/​README.md Corrects the endpoint example.
python/​samples/​02-agents/​harness/​build_your_own_claw/​claw_step04_production_ready/​README.md Clarifies hosted model configuration.
python/​samples/​02-agents/​harness/​build_your_own_claw/​claw_step04_production_ready/​hosted.py Adds model-variable fallback.
python/​samples/​02-agents/​devui/​README.md Corrects endpoint guidance.
python/​samples/​02-agents/​devui/​agent_weather/​.env.example Corrects the endpoint template.
python/​samples/​02-agents/​devui/​agent_foundry/​.env.example Corrects the endpoint template.
python/​samples/​02-agents/​devui/​agent_content_understanding_file_search_foundry/​README.md Corrects Foundry setup.
python/​samples/​02-agents/​devui/​agent_content_understanding_file_search_azure_openai/​README.md Corrects project endpoint setup.
python/​samples/​02-agents/​devui/​.env.example Corrects the endpoint template.
python/​samples/​02-agents/​context_providers/​azure_content_understanding/​README.md Normalizes Foundry setup.
python/​samples/​01-get-started/​04_memory.py Corrects the endpoint example.
python/​samples/​01-get-started/​03_multi_turn.py Corrects the endpoint example.
python/​samples/​01-get-started/​02_add_tools.py Corrects the endpoint example.
python/​samples/​01-get-started/​01_hello_agent.py Corrects the endpoint example.
python/​packages/​azure-cosmos-memory/​README.md Updates project endpoint shapes.
python/​packages/​azure-cosmos-memory/​AGENTS.md Updates provider endpoint guidance.
python/​packages/​azure-contentunderstanding/​README.md Normalizes Foundry configuration.
python/​.env.example Updates endpoint terminology.
dotnet/​samples/​04-hosting/​FoundryHostedAgents/​responses/​Using-Samples/​Hosted-Toolbox-AuthPaths-Client/​README.md Normalizes the client endpoint variable.
dotnet/​samples/​04-hosting/​FoundryHostedAgents/​responses/​Using-Samples/​Hosted-Toolbox-AuthPaths-Client/​Program.cs Uses the normalized endpoint variable.
dotnet/​samples/​04-hosting/​FoundryHostedAgents/​responses/​Hosted-Toolbox/​Program.cs Normalizes endpoint handling.
dotnet/​samples/​04-hosting/​FoundryHostedAgents/​responses/​Hosted-Toolbox-AuthPaths/​Program.cs Normalizes endpoint handling.
dotnet/​samples/​03-workflows/​Declarative/​AotCheckpointing/​README.md Updates required variables.
dotnet/​samples/​02-agents/​Harness/​Harness_Step05_Loop/​README.md Normalizes sample setup.
dotnet/​samples/​02-agents/​Harness/​Harness_Step05_Loop/​Program.cs Uses normalized variables.
dotnet/​samples/​02-agents/​Agents/​Agent_Step15_DeepResearch/​README.md Corrects the endpoint example.
dotnet/​eng/​verify-samples/​AgentsSamples.cs Aligns verifier environment metadata.
dotnet/​.github/​skills/​verify-samples-tool/​SKILL.md Updates verifier guidance.
.github/​workflows/​python-sample-validation.yml Aligns Python validation variables.
.github/​workflows/​dotnet-verify-samples.yml Aligns .NET validation variables.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread python/packages/azure-cosmos-memory/README.md Outdated
@github-actions github-actions Bot changed the title [Python/.NET] Normalize Foundry sample configuration .NET: [Python/.NET] Normalize Foundry sample configuration Oct 5, 2026
@github-actions github-actions Bot changed the title .NET: [Python/.NET] Normalize Foundry sample configuration Python: [Python/.NET] Normalize Foundry sample configuration Oct 5, 2026
@github-code-quality

github-code-quality Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: Python, C#

Python / code-coverage/python

The overall line coverage in commit d634f0f in the urban-journey branch is 92%. Line coverage data for the main branch is not yet available.

Show a line coverage summary of the most covered files.
File main urban-journey d634f0f +/-
packages/core/a...ework/_tools.py — 96% —
packages/core/a...work/_skills.py — 96% —
packages/core/a...ework/_types.py — 95% —
packages/openai..._chat_client.py — 94% —
packages/core/a.../_compaction.py — 94% —
packages/core/a...ork/_vectors.py — 93% —
packages/core/a...amework/_mcp.py — 92% —
packages/ag-ui/...i/_agent_run.py — 90% —
packages/core/a...ork/security.py — 90% —
packages/foundr...g/_responses.py — 88% —

C# / code-coverage/dotnet

The overall line coverage in commit d634f0f in the urban-journey branch is 85%. Line coverage data for the main branch is not yet available.

Show a line coverage summary of the most covered files.
File main urban-journey d634f0f +/-
/home/runner/wo...entsProvider.cs — 100% —
/home/runner/wo...valConverter.cs — 100% —
/home/runner/wo...egatingAgent.cs — 99% —
/home/runner/wo...gentExecutor.cs — 98% —
/home/runner/wo...nticAnalyzer.cs — 94% —
/home/runner/wo...putConverter.cs — 90% —
/home/runner/wo...kflowBuilder.cs — 90% —
/home/runner/wo...SkillsSource.cs — 89% —
/home/runner/wo...ctionVisitor.cs — 75% —
/home/runner/wo...CopilotAgent.cs — 72% —

Updated October 06, 2026 10:06 UTC

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MAF Automated Review — Iteration 1

Result: Findings reported
Scope: full PR (2 commit(s)): 5a0e5cb11871, 34f2b048954e
Model: gpt-5.6-sol

Overview

The PR consistently moves local samples to project-scoped endpoints and FOUNDRY_* model names, while hosted Python paths generally preserve the azd-managed chat-model fallback and validation workflows exercise the normalized configuration. Repository guidance and client tests reinforce the intended endpoint contract. The memory-store provisioning script does not preserve the previously documented embedding-model variable, leaving existing local configurations unable to provision the store.

Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
1 verified finding remained after source verification (1 medium) across 1 file. Details are attached to the affected lines below.

Affected areas: python/samples/04-hosting/foundry-hosted-agents/responses/foundry_memory/provision_memory_store.py

@jpalvarezl Jose Alvarez (jpalvarezl) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. The configuration normalization is consistent across the affected Python and .NET samples, compatibility fallbacks are preserved for hosted deployments, and CI is green. One non-blocking documentation nit is noted inline.

Merged via the queue into main with commit 1aca61d Oct 6, 2026
54 checks passed

This branch was successfully deployed

1 active and 1 inactive deployments
github-app-auth — d634f0f7 Deployed Oct 6, 2026 by eavanvalkenburg via add_label #24506
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs .NET Usage: [Issues, PRs], Target: .Net python Usage: [Issues, PRs], Target: Python workflows Usage: [Issues, PRs], Target: Workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants