Replies: 2 comments 1 reply
-
|
Hi @hhoeksel The 401 in this scenario is almost always caused by using the wrong identity or wrong audience for the A2A call, not by missing “Azure AI User” in general. Based on current Foundry A2A behavior, there are three common gotchas that explain your symptoms.
For Agent‑to‑Agent calls, the Entra token audience must match the Foundry data plane, not the portal. Using: https://ai.azure.com will produce a token that is valid for the portal, but invalid for agent execution, which results in: Correct audience for A2A is: https://cognitiveservices.azure.com This is explicitly required for Foundry agent and workflow execution tokens.
The Azure AI User role must be assigned on: Microsoft.CognitiveServices/accounts (the Foundry resource) Not only on:
Both identities must have access at the Foundry resource scope:
See:
You were right to assign:
However, RBAC propagation can take several minutes, and publishing is required after role assignment for A2A tools to pick up permissions. This behavior is documented and expected at https://learn.microsoft.com/azure/ai-foundry/agents/concepts/agent-identity What to change
That combination resolves the 401 in almost all A2A workflow‑trigger cases. |
Beta Was this translation helpful? Give feedback.
-
|
I also tried the following (unsuccesfull) workaround: created a new connection on the project using the admin tab on operate. created a new a2a connection but now key based, used x-api-key as the key and the keyvalue from my connection as the value. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am having problems configuring agent 2 agent authentication. I am using the new portal. I have created an agent that should start a workflow. Both workflow and agent are published.
I created an agent to agent tool, for the A2A Agent Endpoint I used the URL i found under my workflow (when building) onder the publish button -> view details, so that is something like:
https://myservice.services.ai.azure.com/api/projects/my-project/applications/hello-world-workflow/protocols/activityprotocol?api-version=2025-11-15-preview
I set authentication to Microsoft Entra, type Agent Identification and audience to https://ai.azure.com
So far so good.
Then I lookup the identy of agent that is starting the workflow under the operate tab -> asset, column Entra Id (Application)
In the Azure portal I then went to the Microsoft Foundry project resource and under IAM I added a new role assignment for this id and gave the Azure AI User role.
Now I know that a published agent and when you are building and use the preview option uses different identities so I also looked up that identity (I think) I wen to the overview of the MS Foundry project resource in the Azure Portal. On the overview pane i clicked the JSON view link and found the agentIdentityId field.
Then back to IAM and also assigned this identity the Azure AI user role.
Made sure to publish I published the agent that is calling the workflow ofcourse.
But I am getting this error no matter what I try in the preview and when my agent is called from my logic app (note without the a2a tool it is working fine):
ErrorFailed to fetch agent card: Response status code does not indicate success: 401 (PermissionDenied).
Does anyone have a clue what I am doing wrong here?
Beta Was this translation helpful? Give feedback.
All reactions