Registry /
azure / agent-framework-foundry
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
FoundryAgent
✓ from agent_framework_foundry import FoundryAgent
✗ from agent_framework import FoundryAgent
Library name hyphenated, package uses underscores.
AgentFrameworkClient
✓ from agent_framework_foundry.client import AgentFrameworkClient
✗ from agent_framework import Client
Client class is in the client submodule.
Initialize a Foundry agent and run a simple interaction.
import os
from agent_framework_foundry import FoundryAgent
from agent_framework_foundry.client import AgentFrameworkClient
# Use environment variable for authentication
api_key = os.environ.get('FOUNDRY_API_KEY', '')
client = AgentFrameworkClient(api_key=api_key)
agent = FoundryAgent(
name="my-agent",
instructions="You are a helpful assistant.",
tools=[]
)
response = client.run(agent=agent, input="Hello, world!")
print(response)
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'agent_framework'
Trying to import the library with hyphens or as 'agent-framework-foundry' directly.
fixUse 'from agent_framework_foundry import ...' with underscores.
TypeError: AgentFrameworkClient.__init__() got an unexpected keyword argument 'api_key'
Some versions expect 'credential' parameter instead of 'api_key'. The library uses Azure authentication by default.
fixUse 'credential' or set environment variables. For API key, use 'from agent_framework_foundry.auth import ApiKeyCredential' and pass 'credential=ApiKeyCredential(api_key)'.
AttributeError: 'FoundryAgent' object has no attribute 'run'
The 'run' method is on the client, not on the agent object.
fixCall 'client.run(agent=agent, input=...)' instead of 'agent.run(...)'.
Upgrade
Version history
1.3.0latest on PyPI · released May 8, 2026
Audit
Dependencies
openairequiredCore dependency for agent runtime
azure-identityoptionalAuthentication for Azure services
azure-ai-foundryoptionalAzure AI Foundry SDK for deployment