azd version 1.23.6 (commit 16c72e7)
Walking through Quickstart: Deploy your first hosted agent - Microsoft Foundry | Microsoft Learn
Step - Running the Agent Locally
-
Running python ./src/af-agent-with-foundry-tools/main.py locally crashed immediately with:
AttributeError: type object 'SpanAttributes' has no attribute 'LLM_REQUEST_MODEL'
Root Cause: Version incompatibility between pre-release packages. The quickstart's requirements.txt pinned azure-ai-agentserver-agentframework==1.0.0b12, which pulled in:
opentelemetry-semantic-conventions-ai==0.4.14 — removed LLM_REQUEST_MODEL from SpanAttributes
azure-ai-projects==2.0.0b4 — renamed PromptAgentDefinitionText (caused a second import error after fixing the first)
Both broke imports in agent-framework-core==1.0.0b260107.
Fix: Upgrade the package pin in requirements.txt:
azure-ai-agentserver-agentframework==1.0.0b14
-
web_search_preview tool caused BadRequest — The agent code included {"type": "web_search_preview"} in the tools list, but no Bing Grounding resource was provisioned (all BING_GROUNDING_* env vars were empty). Foundry rejected the request. Fix: removed web_search_preview from the tools array.
Fix: changed tools=[{"type": "web_search_preview"}] to tools=[] in main.py.