A unified Azure platform for creating and managing AI models, agents, and applications with built‑in enterprise security, monitoring, and governance
This usually points to a model/deployment availability issue rather than a basic agent creation problem, especially since the model works in the playground but fails when the agent tries to use it.
Check these items in order:
- Verify the model deployment still exists and is healthy.
- In Foundry, go to Build > Deployments.
- Confirm the deployment name is present and matches exactly what the agent is configured to use.
- If using CLI-managed deployments, verify provisioning completed successfully. A successful deployment should show provisioning state
Succeeded.
- If the agent shows a deployment-not-found style failure, reselect the model in the agent.
- In the agent Build tab, open the model picker.
- Select an available model again and save.
- This is recommended when a model was retired, removed, or became unavailable in the environment.
- Check for quota or capacity issues.
- If the selected model/region/deployment type combination has no available quota or capacity, agent requests can fail even when earlier testing succeeded.
- In the Azure portal, check Azure OpenAI > Quotas.
- If quota is exhausted, request an increase or try a different region with available capacity.
- If the issue is transient capacity pressure, retry later.
- Consider model-specific runtime behavior.
- The context includes examples where certain models worked in deployment but failed at inference time in agent scenarios, while other models in the same subscription worked.
- If this is specific to
Phi-4, test the agent with another supported model deployment. If another model works, the issue is likely model-specific rather than a general agent configuration problem.
- If using a custom connection/gateway-backed model, verify the deployment reference format.
- The model deployment name must use
<connection-name>/<model-name>. - If this format is wrong, requests can fail with model lookup errors.
- The model deployment name must use
- Review deployment or gateway logs.
- For gateway-backed setups, check request logging or API Management analytics to confirm the agent request is reaching the model endpoint and being routed correctly.
If the failure continues after confirming the deployment exists, quota is available, and another model works, the strongest supported conclusion is that this may be a model-specific service/runtime issue with the selected deployment path.
References:
- Quickstart: Deploy your first hosted agent (python)
- Error codes reference for agents
- Quickstart: AI Agent with vector search in Azure DocumentDB using TypeScript
- Deploy models using Azure CLI and Bicep (programming-language-cli)
- Bring your own model to Foundry Agent Service (azure-cli)
- Bring your own model to Foundry Agent Service (foundry-portal)
- Phi-4-mini-instruct deployment hangs indefinitely with 0 token generation in Azure AI Foundry - Microsoft Q&A