How to create agents with Python?

Tran Phuoc Truong Vu 0 Reputation points
2025-06-10T17:37:16.6366667+00:00

I used code example this link: https://learn.microsoft.com/en-us/azure/ai-services/agents/quickstart?pivots=programming-language-python-azure

I also grant role Onwer and PM in this link: https://learn.microsoft.com/en-us/azure/ai-foundry/concepts/rbac-azure-ai-foundry?pivots=fdp-project

But I can't run code example. Please help me this issue

azure.core.exceptions.ClientAuthenticationError: (PermissionDenied) The principal xxxxx lacks the required data action Microsoft.CognitiveServices/accounts/AIServices/agents/write to perform POST /api/projects/{projectName}/assistants operation. For instructions on granting the necessary permissions, see https://aka.ms/FoundryPermissions.

Code: PermissionDenied

Microsoft Security Microsoft Authenticator
{count} votes

Your answer

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