Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform
Regional outage turned out to be the reason, after almost a day, it got fixed on it's own.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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.
azure-ai-projects >= 2.0.0b1azure-identityAzureCliCredential() (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
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
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.
Formerly known as Azure AI Services or Azure Cognitive Services is a unified collection of prebuilt AI capabilities within the Microsoft Foundry platform
Regional outage turned out to be the reason, after almost a day, it got fixed on it's own.
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