Skip to content

Python: [BREAKING] Python: move Azure AI embeddings to Foundry - #5056

Merged
Eduard van Valkenburg (eavanvalkenburg) merged 3 commits into
microsoft:mainfrom
eavanvalkenburg:rename_azure_ai_embeddings
Apr 2, 2026
Merged

Python: [BREAKING] Python: move Azure AI embeddings to Foundry#5056
Eduard van Valkenburg (eavanvalkenburg) merged 3 commits into
microsoft:mainfrom
eavanvalkenburg:rename_azure_ai_embeddings

Conversation

@eavanvalkenburg

@eavanvalkenburg Eduard van Valkenburg (eavanvalkenburg) commented Apr 2, 2026

Copy link
Copy Markdown
Member

Motivation and Context

This PR consolidates the Python provider surface after moving Azure AI inference embeddings into Foundry, removing the now-empty agent-framework-azure-ai package, and aligning environment variable names with the current client split. It also finishes the Azure Cosmos promotion so CosmosHistoryProvider is available from agent_framework.azure and the root samples/docs reflect the promoted import paths.

This is a breaking change because it removes the agent-framework-azure-ai package, replaces the old Azure AI inference embedding class names and import paths with Foundry equivalents, and renames the affected OpenAI/Azure OpenAI/Foundry environment variables.

Description

  • move the Azure AI inference embedding client implementation and tests into agent-framework-foundry as FoundryEmbeddingClient and RawFoundryEmbeddingClient
  • remove the agent-framework-azure-ai package, its embedding-only tests/assets, and the obsolete Azure AI-specific workflow wiring
  • rename OpenAI/Azure OpenAI model environment variables to the *_CHAT_MODEL / *_CHAT_COMPLETION_MODEL scheme and rename Foundry embedding configuration to FOUNDRY_MODELS_*
  • update Python samples, READMEs, .env.example, package-management docs, and CI workflows to use the new names and locations
  • promote agent-framework-azure-cosmos into the agent_framework.azure namespace, add it to agent-framework-core[all], move the Cosmos history provider sample into the root samples/ tree, and add namespace coverage

Fixes: #5003

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings April 2, 2026 09:19
@markwallace-microsoft Mark Wallace (markwallace-microsoft) added documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs python Usage: [Issues, PRs], Target: Python lab labels Apr 2, 2026
@github-actions github-actions Bot changed the title [BREAKING] Python: move Azure AI embeddings to Foundry Python: [BREAKING] Python: move Azure AI embeddings to Foundry Apr 2, 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.

Pull request overview

This PR consolidates the Python provider surface by moving the Azure AI inference embeddings implementation into the Foundry package, removing the now-empty agent-framework-azure-ai package, promoting Cosmos history provider imports via agent_framework.azure, and aligning model-related environment variables to the new *_CHAT_MODEL / *_CHAT_COMPLETION_MODEL scheme.

Changes:

  • Migrate Azure AI inference embeddings into agent-framework-foundry (FoundryEmbeddingClient / RawFoundryEmbeddingClient) and update associated tests/docs/samples.
  • Remove the agent-framework-azure-ai package and update repo config (workspace deps, lockfile, CI workflows) accordingly.
  • Promote CosmosHistoryProvider through agent_framework.azure and relocate/update the Cosmos history provider sample + namespace coverage.

Reviewed changes

Copilot reviewed 67 out of 72 changed files in this pull request and generated no comments.

Show a summary per file
File Description
python/uv.lock Removes agent-framework-azure-ai from the workspace lock; adds Foundry embedding dependency (azure-ai-inference) and includes azure-cosmos in all.
python/pyproject.toml Drops agent-framework-azure-ai from workspace sources and type-check environments.
python/README.md Updates top-level Python README links to point to Foundry instead of the removed Azure AI package.
python/.env.example Renames/expands env var examples for Foundry embeddings and OpenAI/Azure OpenAI model selection.
python/samples/README.md Updates provider/env var matrix to reflect Foundry embeddings and new model env var naming.
python/samples/05-end-to-end/m365-agent/README.md Updates required OpenAI model env var naming for the sample.
python/samples/05-end-to-end/m365-agent/.env.example Updates OpenAI model env var naming for the sample.
python/samples/02-agents/observability/.env.example Updates OpenAI model env var naming.
python/samples/02-agents/middleware/README.md Updates OpenAI model env var naming referenced by the sample.
python/samples/02-agents/mcp/README.md Updates OpenAI model env var naming referenced by the sample.
python/samples/02-agents/embeddings/openai_embeddings_on_azure.py Adds a new Azure OpenAI embeddings sample using OpenAIEmbeddingClient.
python/samples/02-agents/embeddings/foundry_embeddings.py Updates embedding sample to use agent-framework-foundry and FoundryEmbeddingClient.
python/samples/02-agents/devui/workflow_with_agents/workflow.py Updates Azure OpenAI model env var lookup for the DevUI workflow sample.
python/samples/02-agents/devui/workflow_with_agents/.env.example Updates Azure OpenAI model env var naming for the DevUI workflow sample.
python/samples/02-agents/devui/README.md Updates required env var naming for DevUI samples.
python/samples/02-agents/devui/.env.example Updates Azure OpenAI model env var naming for DevUI.
python/samples/02-agents/chat_client/README.md Updates the OpenAI env var descriptions for responses vs chat-completions clients.
python/samples/02-agents/conversations/README.md Adds Cosmos history provider sample entry + prerequisites.
python/samples/02-agents/conversations/cosmos_history_provider.py Switches import to agent_framework.azure.CosmosHistoryProvider and updates sample structure/text.
python/packages/openai/agent_framework_openai/_shared.py Renames model setting fields/env var mappings (responses → chat_model, chat completion → chat_completion_model).
python/packages/openai/agent_framework_openai/_chat_client.py Updates env var documentation and model resolution fields for OpenAIChatClient (Responses).
python/packages/openai/agent_framework_openai/_chat_completion_client.py Updates env var documentation and model resolution fields for OpenAIChatCompletionClient.
python/packages/openai/README.md Updates documented env vars and lookup order to the new naming.
python/packages/openai/tests/openai/conftest.py Updates test env fixtures for the new env var names and semantics.
python/packages/openai/tests/openai/test_openai_chat_client.py Updates env var preference test for OpenAIChatClient.
python/packages/openai/tests/openai/test_openai_chat_client_azure.py Updates Azure env var usage for OpenAIChatClient tests.
python/packages/openai/tests/openai/test_openai_chat_completion_client.py Updates env var preference test for OpenAIChatCompletionClient.
python/packages/openai/tests/openai/test_openai_chat_completion_client_azure.py Updates Azure env var usage for OpenAIChatCompletionClient tests.
python/packages/foundry/pyproject.toml Adds azure-ai-inference dependency now that embeddings live in Foundry.
python/packages/foundry/README.md Updates package description to include embedding integrations.
python/packages/foundry/agent_framework_foundry/_embedding_client.py Introduces Foundry embedding clients/options/settings and new env var names.
python/packages/foundry/agent_framework_foundry/init.py Exports new embedding client symbols from agent_framework_foundry.
python/packages/foundry/tests/foundry/test_foundry_embedding_client.py Migrates embedding tests from agent_framework_azure_ai types to Foundry equivalents.
python/packages/core/pyproject.toml Updates core[all] to include agent-framework-azure-cosmos and drop agent-framework-azure-ai.
python/packages/core/README.md Updates example env vars (removes OPENAI_RESPONSES_MODEL, adds OPENAI_CHAT_COMPLETION_MODEL).
python/packages/core/agent_framework/azure/init.py Promotes CosmosHistoryProvider and removes azure-ai embedding symbols from the azure namespace.
python/packages/core/agent_framework/azure/init.pyi Updates azure namespace type stubs to match the new exported surface.
python/packages/core/agent_framework/foundry/init.py Adds lazy exports for Foundry embedding client symbols.
python/packages/core/agent_framework/foundry/init.pyi Updates Foundry namespace type stubs to include embedding symbols.
python/packages/core/agent_framework/microsoft/init.py Removes Foundry Local symbols from the agent_framework.microsoft namespace.
python/packages/core/agent_framework/microsoft/init.pyi Updates agent_framework.microsoft stubs to match the removed Foundry Local exports.
python/packages/core/tests/core/test_azure_namespace.py Adds coverage asserting agent_framework.azure exposes CosmosHistoryProvider.
python/packages/azure-cosmos/README.md Updates docs to prefer from agent_framework.azure import CosmosHistoryProvider and points to root samples.
python/packages/azure-cosmos/AGENTS.md Updates usage/import-path guidance to include agent_framework.azure promotion.
python/packages/azure-cosmos/samples/README.md Removes package-local samples README (sample moved to root samples).
python/packages/azure-cosmos/samples/init.py Removes package-local samples package marker.
python/packages/azure-ai/tests/conftest.py Removes tests as part of deleting the agent-framework-azure-ai package.
python/packages/azure-ai/tests/azure_openai/test_entra_id_authentication.py Removes tests as part of deleting the agent-framework-azure-ai package.
python/packages/azure-ai/README.md Deletes package docs along with removing agent-framework-azure-ai.
python/packages/azure-ai/pyproject.toml Deletes the agent-framework-azure-ai package manifest.
python/packages/azure-ai/LICENSE Deletes package-level license file along with the removed package.
python/packages/azure-ai/AGENTS.md Deletes package-level agent docs along with the removed package.
python/packages/azure-ai/agent_framework_azure_ai/_shared.py Deletes AzureAISettings and related helpers from the removed package.
python/packages/azure-ai/agent_framework_azure_ai/_entra_id_authentication.py Deletes Entra token-provider helper from the removed package.
python/packages/azure-ai/agent_framework_azure_ai/init.py Deletes package exports along with the removed package.
python/packages/lab/gaia/samples/openai_agent.py Updates OpenAI model env var naming in lab sample docs.
python/packages/devui/dev.md Updates env var naming in DevUI developer docs.
python/packages/devui/frontend/src/components/layout/deployment-modal.tsx Updates example env vars in the deployment modal template snippets.
python/packages/devui/agent_framework_devui/ui/assets/index.js Updates the built frontend asset to match the updated env var snippet.
python/CODING_STANDARD.md Updates repo structure/docs to reference foundry/ instead of azure-ai/.
python/AGENTS.md Updates package listing to reference Foundry and promoted Cosmos integration.
python/.github/skills/python-testing/SKILL.md Updates CI/test documentation to refer to Foundry integration instead of Azure AI.
python/.github/skills/python-package-management/SKILL.md Updates package management documentation to reference Foundry package location.
docs/features/vector-stores-and-embeddings/README.md Updates embedding roadmap text to refer to Foundry package location.
docs/decisions/0021-provider-leading-clients.md Updates env-var naming examples to the new scheme.
.github/workflows/python-sample-validation.yml Updates workflow env var wiring to the new model env var names.
.github/workflows/python-merge-tests.yml Renames path filters/job gating from azure-ai to foundry and updates env var wiring; removes azure-ai samples test step.
.github/workflows/python-integration-tests.yml Updates integration workflow env vars and adds Foundry embedding env vars.
.github/ISSUE_TEMPLATE/python-issue.yml Updates issue template placeholder to reference Foundry package instead of Azure AI.

@markwallace-microsoft

Mark Wallace (markwallace-microsoft) commented Apr 2, 2026

Copy link
Copy Markdown
Contributor

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/foundry/agent_framework_foundry
   _embedding_client.py1131289%152, 167–170, 174, 178, 228, 238, 249, 258, 284
packages/openai/agent_framework_openai
   _chat_client.py85512785%520–523, 527–528, 533–534, 544–545, 552, 567–573, 594, 602, 625, 743, 842, 901, 903, 905, 907, 973, 987, 1067, 1077, 1082, 1125, 1202, 1232, 1289, 1382, 1387, 1391–1393, 1397–1398, 1464, 1493, 1499, 1509, 1515, 1520, 1526, 1531–1532, 1593, 1615–1616, 1631–1632, 1650–1651, 1692–1695, 1857, 1895–1896, 1912, 1914, 1992–2000, 2122, 2157, 2172, 2192–2202, 2215, 2226–2230, 2244, 2258–2269, 2278, 2310–2313, 2321–2322, 2324–2326, 2340–2342, 2352–2353, 2359, 2374
   _chat_completion_client.py3562892%428, 524–525, 529, 666, 749–756, 758–761, 771, 849, 851, 868, 889, 917, 930, 954, 974, 1014, 1289
   _shared.py1351489%239–241, 253, 263, 271, 275, 281, 300–301, 320, 339–340, 342
TOTAL27038318688% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
5370 20 💤 0 ❌ 0 🔥 1m 25s ⏱️

Merged via the queue into microsoft:main with commit 95fd5ec Apr 2, 2026
43 of 44 checks passed
Ben Thomas (alliscode) pushed a commit to alliscode/agent-framework that referenced this pull request Apr 3, 2026
…soft#5056)

* renamed AzureAIINferenceEmbeddings and lazy load azure-cosmos and env var rename

* updated coverage

* fix readme
@eavanvalkenburg
Eduard van Valkenburg (eavanvalkenburg) deleted the rename_azure_ai_embeddings branch June 30, 2026 09:02
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 python Usage: [Issues, PRs], Target: Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: add released package to core[all] and move samples

6 participants