Lesson 3 of 3 MLOps Foundations and the Azure Machine Learning Workspace

Datastores and Storage Access

This lesson explains what a datastore references, how default datastores and URIs work, how credential-based and identity-based access differ, and what firewalled storage requires.

Learning outcomes

After completing this lesson, you will be able to:

  • Explain what a datastore is and what it does not contain.
  • Describe the default datastores and datastore URIs.
  • Distinguish credential-based from identity-based access.
  • Identify the network requirements of firewalled storage.

What a datastore is

A datastore is a named connection from a workspace to an Azure storage service. It stores the account, container or file system, and optionally a credential, but no data. Jobs and data assets refer to data through the datastore, so the location and access method are defined once, and code does not contain connection strings.

Azure Machine Learning supports four datastore types: Azure Blob Storage (azure_blob), Azure Data Lake Storage Gen2 (azure_data_lake_gen2), Azure Files (azure_file) and Microsoft OneLake (one_lake) in Microsoft Fabric. A datastore is created from a YAML file with az ml datastore create or with the SDK.

$schema: https://azuremlschemas.azureedge.net/latest/azureDataLakeGen2.schema.json
name: sales_lake
type: azure_data_lake_gen2
description: Curated sales data for churn models
account_name: stsalescurated
filesystem: curated

Default datastores and URIs

Every workspace has datastores that point to its own storage account. workspaceblobstore is the default datastore, used for job outputs and uploaded data unless another is chosen; workspacefilestore holds notebooks and files for compute instances; workspaceartifactstore and workspaceworkingdirectory hold run artifacts and working files. You can change which datastore is the default, but most teams register additional datastores for curated data instead.

Data on a datastore is addressed with an azureml URI, which works the same way whatever the storage type. Jobs can also use direct storage URIs such as abfss:// and https://, but datastore URIs keep the account details out of job definitions.

FormExampleUse
Datastore pathazureml://datastores/sales_lake/paths/2026/orders/Data on a registered datastore
Data assetazureml:orders:3A specific version of a registered data asset
Direct storage URIabfss://[email protected]/orders/Data reached without a datastore

Credential-based and identity-based access

A datastore authenticates in one of two ways, and the choice is a security decision. A credential-based datastore stores an account key, a shared access signature (SAS) token or a service principal secret in the workspace key vault, and every user and job that uses the datastore acts with that credential. An identity-based (credential-less) datastore stores no secret.

Credential-based
Stored secretAccount key, SAS token or service principal secret
Who is authorizedAnyone who can use the datastore
RotationSecrets must be rotated and updated
PermissionsEffectively the credential's full rights
Choose when Legacy storage that cannot use Microsoft Entra ID
Identity-based
Stored secretNone
Who is authorizedThe user's or the compute's own identity
RotationNothing to rotate
PermissionsStorage data roles per identity
Choose when The recommended default for Azure storage

With identity-based access, a user browsing or previewing data in the studio uses their own Microsoft Entra identity. A job uses the identity it runs with: the submitting user's identity, or the managed identity of the compute cluster or of the workspace, depending on the job's identity setting. Each identity needs a data role on the storage, such as Storage Blob Data Reader for reading or Storage Blob Data Contributor for writing outputs. The workspace's own system datastores can also be switched to identity-based access, a preview setting, so that the default storage account no longer needs shared key access.

Two identities, two role assignments

An identity-based datastore that works in the studio but fails in a job usually means the user has a storage role and the compute identity does not. Grant the role to the identity the job actually runs with.

Network and firewall considerations

Storage accounts that restrict access with firewalls or private endpoints must still be reachable from the workspace and its compute. When the workspace uses a managed virtual network, private endpoints to the workspace's own storage are created automatically, and additional storage accounts are reached through private endpoint outbound rules. When compute runs in your own virtual network, the storage account's firewall must allow that subnet or have a private endpoint in it.

The studio's data preview runs from the browser through the workspace, so a storage account that allows only private access can make previews fail even though jobs work. This is expected behaviour rather than a datastore misconfiguration, and is resolved by connecting from a network that can reach the private endpoints.

Worked example

Removing stored keys from datastores

A workspace has a Blob Storage datastore that stores the storage account key. A security review requires that no storage keys be stored, that data scientists see only the containers they need, and that training jobs on a compute cluster can still read the data. What should the team do?

Recreate the datastore as an identity-based datastore with no credentials. Grant each data scientist Storage Blob Data Reader on the containers they need, so studio access follows their own identity. Give the compute cluster a managed identity, grant it Storage Blob Data Reader on the training container, and run jobs with that identity. Finally, disable shared key access on the storage account if nothing else uses it.

Replacing the key with a SAS token still stores a secret and gives every user the same access. Storing the key in a different key vault moves the secret but does not remove it. Granting data scientists Contributor on the storage account gives management rights but no data-plane read access, and it exceeds what they need.

Check yourself

A datastore is changed to identity-based access, and a data scientist's job now fails with an authorization error. What is missing?

Show answer

An identity-based datastore stores no credential, so the identity that reads the data, the user or the compute's managed identity, needs a data role such as Storage Blob Data Reader on the storage account.

Exam Tips

Remember for the exam

  • A datastore references Blob Storage, ADLS Gen2, Azure Files or OneLake; it holds no data.
  • workspaceblobstore is the default datastore for outputs and uploads.
  • Identity-based datastores store no secret; users and compute need storage data roles.
  • Firewalled storage needs a network path from the compute, such as a private endpoint rule.