An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
Hello Surya Chauhan,
Welcome to Microsoft Q&A .Thank you for reaching out.
The integration is correctly configured. The failure is caused by an unsupported token audience value in the agent’s managed identity configuration, preventing authentication from reaching the function app.
The expected flow is that the
- Agent acquires a Managed Identity access token
- Token is sent to the Function App
- Function App validates the token via Entra ID
- Function code executes and returns a response
However, the Agent tool call fails with a system_error / ValueError, while the Function App shows zero invocations.
From the provided information and screenshots , we can see that the Invocation count = 0 .This confirms the Function code is never executed. The failure occurs before the request reaches the function app runtime at the authentication layer.
The identified root cause is that the Agent’s Managed Identity is requesting an access token using an unsupported audience value for Azure Function App authentication.While the function app allows multiple token audiences, Azure AI Agent + Managed Identity authentication reliably works only when the audience is set to the Application ID URI of the Function App’s Entra ID app registration
format: api://<client-id>
Using the Function App URL
https://<app>.azurewebsites.net
as the audience causes the token validation to fail silently.
Please check if the following resolution steps help:
1. Update Agent OpenAPI Tool Configuration
- Authentication method: Managed Identity
- Audience:
api://<Function App Application (client) ID>
2. Verify Function App Authentication
- Authentication enabled (Entra ID)
- Allowed token audiences include:
api://<client-id>
3.Please do not rely on IAM (RBAC) for inbound calls
- RBAC controls resource management only
- HTTP access is governed by Entra ID authentication
4. As a validation check after updating the audience , see if
- Function invocation count increases
- Agent receives a successful response
- No code changes required in the Function App
References:
Secure OpenAPI tool calls from Foundry Agent Service - Azure App Service | Microsoft Learn
Connect OpenAPI tools to Microsoft Foundry agents - Microsoft Foundry | Microsoft Learn
Thank you!