Understanding Identity for Azure Machine Learning
This lesson explains which identities make requests in Azure Machine Learning, how control plane and data plane permissions differ, and how code authenticates.
Learning outcomes
After completing this lesson, you will be able to:
- Identify the identities involved in jobs, compute and endpoints.
- Distinguish control plane from data plane roles.
- Explain least privilege and role scope.
- Describe how DefaultAzureCredential selects a credential.
Who and what makes requests
An MLOps platform has more identities than people. A data scientist opens the studio and submits a job; the job runs on compute and reads data; the workspace stores secrets and pulls images; a GitHub workflow deploys a model; an endpoint pulls the model and serves requests from an application. Each of these actors authenticates with Microsoft Entra ID and must be authorized separately.
| Identity | Kind | Typical use |
|---|---|---|
| Data scientist or engineer | User account | Studio, notebooks, submitting jobs, viewing results |
| GitHub workflow | App registration or user-assigned managed identity with a federated credential | Provisioning, job submission and deployment from CI/CD |
| Workspace | System-assigned or user-assigned managed identity | Accessing storage, key vault and container registry |
| Compute cluster or instance | System-assigned or user-assigned managed identity | Reading data and writing outputs during jobs |
| Online endpoint | System-assigned or user-assigned managed identity | Pulling the image and model, calling other services |
| Client application | Its own managed identity or user token | Calling the endpoint with Microsoft Entra authentication |
Control plane and data plane
Azure distinguishes two planes of access. The control plane manages resources: creating a workspace, a storage account or a role assignment, through Azure Resource Manager. The data plane works with what is inside them: reading blobs, getting a secret, pulling an image. Roles are written for one plane or both, and having one does not imply the other.
This distinction explains many exam scenarios. Contributor on a storage account lets a user manage the account but not read blobs with Microsoft Entra ID; that needs a data role such as Storage Blob Data Reader. Azure Machine Learning roles combine both for the workspace's own operations: AzureML Data Scientist includes the data actions to submit jobs and register models. For connected resources, such as storage behind a datastore, the data roles must be granted on those resources.
Management is not data access
Owner or Contributor on a subscription does not grant data access to Blob Storage when access is through Microsoft Entra ID. A job that fails with an authorization error on a datastore usually needs a Storage Blob Data role for its identity, not a broader management role.
Least privilege and scope
Role assignments have a scope: a management group, subscription, resource group or resource, and some roles can be scoped further, such as to one storage container. A role assigned at a scope applies to everything below it. Least privilege means choosing the narrowest role and the narrowest scope that let an identity do its work, and reviewing assignments as responsibilities change.
- Assign workspace roles on the workspace, not on the subscription.
- Assign storage data roles on the container a job uses, not on the whole account.
- Give automation identities only the roles their workflow needs, one identity per environment.
- Use groups for people, so that joining or leaving a team updates access in one place.
Authentication from code
Code authenticates with the Azure Identity library. DefaultAzureCredential tries a sequence of methods, including environment variables, workload identity, managed identity, the Azure CLI sign-in and developer tools, and uses the first that works. The same code therefore authenticates as the developer on a laptop, as the compute's managed identity in a job, and as the workflow's identity in GitHub Actions after azure/login.
from azure.ai.ml import MLClient
from azure.identity import DefaultAzureCredential
# Works with the CLI sign-in locally, a managed identity on compute, or OIDC in GitHub Actions.
ml_client = MLClient.from_config(credential=DefaultAzureCredential())MLClient.from_config() reads the subscription, resource group and workspace from a config.json file, which compute instances provide automatically. In pipelines, the values are usually passed as environment variables or arguments instead.
Diagnosing an authorization failure
A data scientist can preview files from an identity-based datastore in the studio, but a training job on a compute cluster fails with an AuthorizationPermissionMismatch error when it reads the same files. The cluster has a system-assigned managed identity, and the job is configured to run with the compute's managed identity. The data scientist holds Storage Blob Data Reader on the container.
The studio preview uses the data scientist's identity, which has a data role, while the job uses the cluster's managed identity, which does not. The fix is to grant the cluster's managed identity Storage Blob Data Reader on the container, or Storage Blob Data Contributor if the job also writes there.
Granting the cluster identity Contributor on the storage account would allow management operations but not reading blobs. Switching the datastore to an account key would fix the error by storing a secret, which reverses the security design. Granting the data scientist more rights changes nothing, because the job does not run as the data scientist.
A user has Contributor on a storage account but cannot read blobs through an identity-based datastore. Why?
Show answer
Contributor is a control plane role: it manages the account but grants no data access through Microsoft Entra ID. Reading blobs needs a data plane role such as Storage Blob Data Reader.
Exam Tips
Remember for the exam
- People, workflows, workspaces, compute and endpoints are all separate identities.
- Control plane roles manage resources; data plane roles access their contents.
- Contributor on storage does not allow reading blobs through Microsoft Entra ID.
- DefaultAzureCredential lets the same code run as a user, a managed identity or a workflow.