Azure AI Foundry Agent returns 403 “RBAC: access denied” when calling responses.create() – can read agent but cannot execute it

Waqas Hussain 131 Reputation points
2026-02-18T12:06:23.2366667+00:00

I’m running into a consistent 403 – RBAC: access denied error when invoking an Azure AI Foundry Agent via the Python SDK, even though I can successfully retrieve the agent metadata.

Environment

  • Azure AI Services account
  • SDK:
    • azure-ai-projects >= 2.0.0b1
    • azure-identity
  • Authentication: AzureCliCredential() (confirmed correct user identity)

What works

I can successfully retrieve the agent:

from azure.identity import AzureCliCredential
from azure.ai.projects import AIProjectClient
project_client = AIProjectClient(
    endpoint="https://valid-endpoint",
    credential=AzureCliCredential(),
)
agent = project_client.agents.get(agent_name="my-agent-gpt")
print(agent.name)

Output:

Retrieved agent: AgentX

What fails

When I try to invoke the agent:

openai_client = project_client.get_openai_client()
response = openai_client.responses.create(
    input=[{"role": "user", "content": "Tell me what you can help with."}],
    extra_body={"agent": {"name": agent.name, "type": "agent_reference"}},
)

I get

openai.PermissionDeniedError: RBAC: access denied
status_code: 403
request_id: bb803a7dc1ac78d4b9ff3447974c31cf
azureml-served-by-cluster: hyena-region-...

Response body:

RBAC: access denied

Important details

  1. Role assignments include:
    • Cognitive Services OpenAI Contributor (on account)
    • Azure AI Owner (subscription)
    • Azure AI Owner (project scope)
    • Azure AI User (resource group)
    • Azure AI Developer (resource group)
  2. I can:
    • Read the agent definition
    • Access the AI Services account
    • See and manage the project
  3. I cannot:
    • Execute the agent via responses.create()

And to make this situation even more complicated, it was working perfectly fine just few hours ago!

Furthermore, I cannot even use the agent in Foundry playground, it says an error has occured.

Foundry Tools
Foundry Tools

Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform

0 comments No comments

2 answers

Sort by: Most helpful
  1. Waqas Hussain 131 Reputation points
    2026-02-26T03:29:40.6533333+00:00

    Regional outage turned out to be the reason, after almost a day, it got fixed on it's own.

    Was this answer helpful?


  2. Alex Burlachenko 25,115 Reputation points MVP Volunteer Moderator
    2026-02-18T12:56:46.65+00:00

    Hi Waqas Hussain,

    this is not a metadata RBAC issue because u can read the agent. It is a data plane permission failure on the OpenAI execution endpoint. Getting the agent uses project level control plane permissions, but responses.create() hits the OpenAI data plane and requires Cognitive Services OpenAI User or a role that includes Microsoft.CognitiveServices/accounts/openai/*/read and invoke permissions at the AI Services account scope. Cognitive Services OpenAI Contributor is not always enough for execution depending on recent role definition updates. Is that role is assigned directly at the AI Services account level, not only subscription or RG, and that it includes dataActions. Also confirm u are authenticating against the correct tenant and subscription because AzureCliCredential will use the currently logged in context, which may not match the resource tenant.

    So it worked a few hours ago and now fails even in the playground, this strongly suggests either a recent RBAC change, role propagation delay, or a backend incident in that region. Run az role assignment list --assignee <your-object-id> --scope <AI account resource id> and verify the role is present. sign out and back in to refresh tokens, wait 15 to 30 minutes for RBAC propagation.

    If playground also fails, and roles are correct, this may be a regional backend issue. In that case check Azure Service Health and open a support ticket with the request_id and timestamp because data plane RBAC 403 at execution time is not something u can override locally once roles are correct.

    rgds,

    Alex

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.