I get this error message when trying to create an agent in . How to resolve this? - Message: Identity(object id: c9e91242-b841-4102-891e-e423a03ea18a) does not have permissions for Microsoft.MachineLearningServices/workspaces/agents/action actions.

Srinivasan, Vignesh 40 Reputation points
2025-02-28T08:20:49.73+00:00

Hey i am trying to create an agent using project_client.agents.create_agent function but I get the following error message . How do i resolve this?

**
Creating agent...**

ERROR:main:An error occurred initializing the agent: (UserError) Identity(object id: c9e91242-b841-4102-891e-e423a03ea18a) does not have permissions for Microsoft.MachineLearningServices/workspaces/agents/action actions. Please refer to https://aka.ms/azureml-auth-troubleshooting to fix the permissions issue.

Code: UserError

Message: Identity(object id: c9e91242-b841-4102-891e-e423a03ea18a) does not have permissions for Microsoft.MachineLearningServices/workspaces/agents/action actions. Please refer to https://aka.ms/azureml-auth-troubleshooting to fix the permissions issue.

Azure Machine Learning
Azure Machine Learning
An Azure machine learning service for building and deploying models.
3,194 questions
0 comments No comments
{count} votes

Accepted answer
  1. JAYA SHANKAR G S 1,450 Reputation points Microsoft External Staff
    2025-03-03T03:25:06.4166667+00:00

    Hi Srinivasan, Vignesh,

    as Amira Bedhiafi mentioned you need to add role assignment, but the role you need to add is Azure AI Developer, after you assigning the role wait for few minutes and try.

    Check the prerequisites here.

    Please do let me know if any query.

    Thank you


Accepted answer
  1. Amira Bedhiafi 30,576 Reputation points
    2025-03-02T21:54:54.9933333+00:00

    Can you confirm what is the identity used based on the error message ?

    This could be a service principal, managed identity, or user account.

    The identity needs to have the appropriate role assigned in the Azure Machine Learning workspace. The most common role for managing agents is Contributor or Owner.

    If you need more granular permissions, you can create a custom role with the specific action Microsoft.MachineLearningServices/workspaces/agents/action.

    Steps to Assign a Role:

    • Go to the Azure Portal.
    • Navigate to your Azure Machine Learning workspace.
    • In the left-hand menu, select Access control (IAM).
    • Click Add role assignment.
    • Choose the appropriate role (Contributor or Owner) and assign it to the identity (using the object ID c9e91242-b841-4102-891e-e423a03ea18a)
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.