Lesson 2 of 3 Identity and Access Management for Workspaces

Role-Based Access Control for Workspaces

This lesson explains the built-in Azure Machine Learning roles, when custom roles are needed, and how roles are designed for data scientists, platform engineers and automation.

Learning outcomes

After completing this lesson, you will be able to:

  • Compare the AzureML Data Scientist, Compute Operator and Registry User roles.
  • Describe the parts of a custom role definition.
  • Choose roles for a separation of duties.
  • Identify roles needed outside the workspace.

Built-in roles

The general Azure roles, Owner, Contributor and Reader, work on a workspace as on any resource. Azure Machine Learning adds narrower roles for the people who use a workspace day to day. The following table summarizes the roles the exam expects you to distinguish.

RoleCanCannot
OwnerEverything, including assigning rolesNothing is excluded
ContributorEverything except assigning rolesGrant access to others
ReaderView the workspace and its assetsRun jobs, create assets or change anything
AzureML Data ScientistRun jobs, register models, create endpoints and deployments, use compute and datastoresCreate or delete compute, change workspace settings, assign roles
AzureML Compute OperatorCreate, manage and delete compute resourcesRun jobs or manage other assets
AzureML Registry UserRead, write and delete assets in a registryCreate or delete the registry itself

The two machine learning roles split responsibilities cleanly: a platform team holds AzureML Compute Operator and decides what compute exists, and data scientists hold AzureML Data Scientist and use it. Creating or deleting a registry still needs Contributor or Owner.

Custom roles

When no built-in role fits, a custom role lists the allowed Actions and DataActions, optionally excludes some with NotActions and NotDataActions, and sets the AssignableScopes where it can be used. Azure Machine Learning actions are named after the resource path, such as Microsoft.MachineLearningServices/workspaces/jobs/write or Microsoft.MachineLearningServices/workspaces/onlineEndpoints/deployments/write.

{
  "Name": "ML Job Runner",
  "IsCustom": true,
  "Description": "Submit and view jobs, but not deploy models or manage compute.",
  "Actions": [
    "Microsoft.MachineLearningServices/workspaces/read",
    "Microsoft.MachineLearningServices/workspaces/jobs/*",
    "Microsoft.MachineLearningServices/workspaces/data/*",
    "Microsoft.MachineLearningServices/workspaces/environments/*",
    "Microsoft.MachineLearningServices/workspaces/computes/read"
  ],
  "NotActions": [],
  "AssignableScopes": ["/subscriptions/SUBSCRIPTION_ID/resourceGroups/rg-ml-dev"]
}

The role is created with az role definition create --role-definition role.json and assigned like any other. Wildcards are convenient but can include actions added in the future, so production roles often list actions explicitly.

Typical role designs

Most organizations map roles to responsibilities in each environment. The development workspace is permissive so that experimentation is easy; the production workspace is restrictive so that only automation changes it.

Development workspace
Data scientistsAzureML Data Scientist
Platform teamAzureML Compute Operator or Contributor
Release workflow identityAzureML Data Scientist
Changes made byPeople and automation
Choose when Fast experimentation
Production workspace
Data scientistsReader, or no access
Platform teamContributor through privileged access workflows
Release workflow identityAzureML Data Scientist or a custom deployment role
Changes made byAutomation only
Choose when Controlled, auditable releases

Microsoft Entra Privileged Identity Management (PIM) can make high-privilege roles eligible rather than permanent, so an engineer activates Contributor on the production workspace for a few hours with a justification when a manual fix is needed.

Roles beyond the workspace

A workspace role does not grant access to the resources around it. Data on a datastore needs storage data roles; images in a separately managed container registry need AcrPull for compute and endpoints; secrets read by a job from an external key vault need Key Vault Secrets User. A registry needs AzureML Registry User for people and workflows that publish or consume its assets.

When access fails, the question is always which identity made the call and which resource it called. That identifies the missing assignment more reliably than granting broader roles until the error disappears.

Worked example

Least privilege for a platform split

A company's platform team must control which compute clusters exist and their sizes, to manage cost. Data scientists must be able to submit jobs, register models and deploy them to test endpoints in the development workspace, but must not create compute. Which roles should each group receive on the development workspace?

The platform team receives AzureML Compute Operator, which allows creating, scaling and deleting compute. The data scientists receive AzureML Data Scientist, which allows jobs, model registration and endpoint deployments, and explicitly excludes creating or deleting compute. Both roles are assigned on the workspace, to Microsoft Entra groups.

Contributor for data scientists would let them create compute. Reader would not let them submit jobs. Giving the platform team Owner would work but exceeds what they need, because they do not need to assign roles.

Check yourself

Data scientists must run jobs and deploy models but must not create or delete compute. Which built-in role fits?

Show answer

AzureML Data Scientist. It allows almost all workspace actions, including jobs and deployments, but excludes creating and deleting compute and managing the workspace itself.

Exam Tips

Remember for the exam

  • AzureML Data Scientist runs jobs and deploys models but cannot create or delete compute.
  • AzureML Compute Operator manages compute.
  • AzureML Registry User manages assets in a registry; creating a registry needs Contributor.
  • Custom roles list Actions and DataActions with AssignableScopes.