Prerequisites
- Test your agent thoroughly in the Foundry portal before publishing. Confirm it responds correctly and any tools work as expected.
- Publish your agent as an Agent Application: An Agent Application is a managed Azure resource that wraps your agent with a stable endpoint for external consumption. To publish your agent, see Publish and share agents in Microsoft Foundry.
- Azure AI User role on the Agent Application scope to chat with a published agent using the Responses API protocol
- Install the
openaiandazure-identitypackages and authenticate as described in Prepare your development environment.
Use OpenAI client with Agent Applications endpoint
Limitations
| Limitation | Description |
|---|---|
| Stateless Responses API only | Only the stateless Responses API is supported. Other APIs including /conversations, /files, /vector_stores, and /containers are inaccessible. |
Troubleshooting
| Issue | Likely cause | Resolution |
|---|---|---|
403 Forbidden when invoking the endpoint | Caller lacks invoke permissions on the Agent Application resource | Assign the Azure AI User role on the Agent Application resource to the caller. |
401 Unauthorized when invoking the endpoint | The access token is missing, expired, or for the wrong resource | Reauthenticate and request a token for https://ai.azure.com. |
| Tool calls fail after publishing | The Agent Application identity doesn’t have the same access as the project identity | Reassign the required RBAC roles to the published agent identity for any downstream Azure resources it must access. |
| Multi-turn conversations don’t work as expected | Agent Applications don’t store conversation state for you | Store conversation history in your client and send the context as part of your request. |