Study guide

2.2 Create and Manage Datastores

Microsoft AI-300: Operationalizing Machine Learning and Generative AI Solutions Exam

Track your progress as you read

Finished sections get a check mark.

1 Introduction & Exam Overview

1.1 Current Exam Facts 1.2 Skills Measured, Format, and How This Guide Is Organized 1.3 Candidate Profile, Azure ML v2, Foundry, and DevOps Tooling

2 Chapter 2: Azure Machine Learning Workspaces, Datastores, Compute, and IAM

2.1 Create and Manage Azure Machine Learning Workspaces 2.2 Create and Manage Datastores 2.3 Create and Manage Compute Targets 2.4 Configure Identity and Access Management for Workspaces

3 Chapter 3: Azure Machine Learning Data Assets, Environments, Components, and Registries

3.1 Create and Manage Data Assets 3.2 Create and Manage Environments 3.3 Create and Manage Components 3.4 Share Assets Across Workspaces with Registries

4 Chapter 4: Infrastructure as Code, GitHub, and Network Isolation for Azure ML

4.1 GitHub Integration and Git Source Control for Machine Learning Projects 4.2 Deploy Workspaces and Resources with Bicep and Azure CLI 4.3 Automate Resource Provisioning with GitHub Actions 4.4 Restrict Network Access to Machine Learning Workspaces

5 Chapter 5: MLflow Tracking, AutoML, Training Jobs, and Hyperparameter Sweeps

5.1 Configure Experiment Tracking with MLflow 5.2 Use Automated Machine Learning to Explore Optimal Models 5.3 Notebooks, Command Jobs, and Training Scripts 5.4 Automate Hyperparameter Tuning

6 Chapter 6: Distributed Training, Training Pipelines, and Job Comparison

6.1 Manage Distributed Training for Large and Deep Learning Models 6.2 Implement Training Pipelines 6.3 Compare Model Performance Across Jobs

7 Chapter 7: Model Registration, Responsible AI, and Lifecycle Management

7.1 Register MLflow Models and Package Feature Retrieval Specs 7.2 Evaluate Models with Responsible AI Principles 7.3 Manage Model Lifecycle and Archiving

8 Chapter 8: Online Endpoints, Batch Endpoints, Rollout, and Rollback

8.1 Deploy Models to Managed Online Endpoints 8.2 Deploy Models to Batch Endpoints 8.3 Test, Troubleshoot, Progressive Rollout, and Safe Rollback

9 Chapter 9: Data Drift, Production Metrics, Retraining, and Alerts

9.1 Detect and Analyze Data Drift 9.2 Monitor Production Metrics and Trigger Retraining or Alerts

10 Chapter 10: Microsoft Foundry Resources, IAM, Networking, and IaC

10.1 Create and Configure Foundry Resources and Project Environments 10.2 Managed Identities and RBAC for Foundry 10.3 Foundry Network Security and Private Networking 10.4 Deploy Foundry Infrastructure with Bicep and Azure CLI

11 Chapter 11: Deploying and Managing Foundation Models

11.1 Serverless API Endpoints and Managed Compute for Foundation Models 11.2 Select Foundation Models for Specific Use Cases 11.3 Model Versioning and Production Deployment Strategies 11.4 Provisioned Throughput Units for High-Volume Workloads

12 Chapter 12: Prompt Design, Variants, and Git Version Control

12.1 Design and Develop Prompts 12.2 Create Prompt Variants and Compare Performance 12.3 Version Control for Prompts with Git

13 Chapter 13: Evaluation Datasets, Quality Metrics, Safety, and Automated Workflows

13.1 Test Datasets and Data Mapping for Evaluation 13.2 Groundedness, Relevance, Coherence, and Fluency 13.3 Risk and Safety Evaluations 13.4 Built-in and Custom Automated Evaluation Workflows

14 Chapter 14: Continuous Monitoring, Performance, Cost, Tracing, and Logging

14.1 Continuous Monitoring in Microsoft Foundry 14.2 Latency, Throughput, Token Use, and Cost Metrics 14.3 Logging, Distributed Tracing, and Production Debugging

15 Chapter 15: Retrieval Tuning, Embeddings, Hybrid Search, and RAG Evaluation

15.1 Tune Similarity Thresholds, Chunk Sizes, and Retrieval Strategies 15.2 Select and Fine-Tune Embedding Models 15.3 Hybrid Search: Semantic and Keyword Retrieval 15.4 RAG Relevance Metrics and A/B Testing

16 Chapter 16: Fine-Tuning Methods, Synthetic Data, and Promotion to Production

16.1 Advanced Fine-Tuning Methods (LoRA, QLoRA, Full) 16.2 Create and Manage Synthetic Data for Fine-Tuning 16.3 Monitor, Optimize, and Promote Fine-Tuned Models

2.2 Create and Manage Datastores

Key Takeaways Explain This Topic AI

A datastore is a named reference to an existing Azure storage account; creating a datastore does not provision storage.

Supported connections for current work include Azure Blob Storage, Azure Data Lake Storage Gen2, and Azure Files; Azure Data Lake Storage Gen1 retired on 2024-02-29.

Credential-based datastores cache account keys, SAS tokens, or service principal secrets in the workspace Key Vault; identity-based datastores store no secrets and authenticate with Microsoft Entra ID or a managed identity.

Identity-based authentication is supported for Blob and ADLS Gen2, not for Azure Files; grant Storage Blob Data Reader (or tighter ACLs on ADLS Gen2) to the user or compute identity.

Every workspace has default datastores on its associated account, including workspaceblobstore for uploads and snapshots; extra datastores point at lakes, premium accounts, or other containers the default store cannot be.

Last updated: August 2026

Create and Manage Datastores

Quick Answer: A datastore is a pointer to storage you already own. Use identity-based access (workspace or compute managed identity, Storage Blob Data Reader) for Blob and ADLS Gen2. Use keys, SAS, or a service principal only when identity-based access is unavailable—Azure Files has no identity-based option. Never paste account keys into notebooks.

A datastore is not a data asset and not a storage account. It is a named connection that Azure Machine Learning keeps in the workspace so jobs, data assets, and studio browsers can reach Azure storage through one API. The storage account already exists; az ml datastore create and MLClient.create_or_update only register the connection.

That distinction is the first exam filter. If the stem says “create a datastore,” the correct action is to link Blob, ADLS Gen2, or Azure Files. If the stem says “create a data asset,” you are versioning a URI (file, folder, or table) that usually sits on a datastore. Chapter 3 covers data assets; this section stays on the connection object.

  • What datastores buy you
  • One API for Blob, Files, and ADLS Gen2 so training code can take a URI instead of a storage SDK maze
  • Discoverable names ( adls_claims_gold ) so teammates do not copy long abfss:// strings
  • For credential-based connections, secrets live in the workspace Key Vault instead of in Git

Datastores do not copy data into the workspace. They do not replace Azure RBAC on the storage account. A user who can see a datastore in studio still needs a data-plane role (or a cached credential) to read bytes.

Default datastores versus additional datastores

Every workspace already has datastores on its associated storage account. You do not create these; you need to know what they are for so you do not dump a 2 TB lake into the same containers that hold notebook files.

Datastore name Storage shape Typical contents

workspaceblobstore Blob container azureml-blobstore-{workspace-id} Data uploads, job code snapshots, pipeline data cache. This is the default datastore for many upload paths.

  • workspaceworkingdirectory File share code-{GUID} Notebooks, compute-instance user files, prompt-flow files
  • workspacefilestore File share azureml-filestore-{workspace-id} Alternate upload target
  • workspaceartifactstore Blob container azureml Metrics, models, and component artifacts

Additional datastores are the ones you create for project data: a Blob container of images, an ADLS Gen2 filesystem of parquet, an Azure Files share that a lift-and-shift app already writes to, or (preview) a Microsoft Fabric OneLake lakehouse. Extra datastores are also how you attach the account types that cannot be default workspace storage—premium Blob and hierarchical-namespace ADLS Gen2 from section 2.1.

Keep training data off workspaceworkingdirectory . That file share is mounted as the notebook working directory on every compute instance in the workspace. Small notebook writes are fine; large training corpora belong on Blob or ADLS Gen2 datastores and should be mounted into jobs , not into the notebook share.

Supported storage and authentication matrix

Current Azure Machine Learning datastore types you should design for in 2026:

  • Azure Blob Storage — credential-based or identity-based
  • Azure Data Lake Storage Gen2 — credential-based or identity-based

Azure Files — credential-based only (account key or SAS). There is no identity-based Files datastore.

Microsoft Fabric OneLake — preview; identity-based or service principal, targeting lakehouse Files

Azure Data Lake Storage Gen1 — retired 29 February 2024. You cannot create new Gen1 accounts; existing Gen1 data is inaccessible. New work uses Gen2.

Credential-based authentication means Azure Machine Learning stores a secret:

  • Storage account key
  • Shared access signature (SAS) token

Service principal (tenant ID, client ID, client secret)—common for ADLS Gen2 when a central app registration is the only identity the lake will trust

Those secrets land in the workspace Key Vault. Anyone whose workspace role includes Microsoft.MachineLearningServices/workspaces/datastores/listsecrets/action can retrieve them. Built-in Contributor , AzureML Data Scientist , and Azure AI Developer include that action. Reader can list and view datastore credentials in the workspace even though Reader cannot create assets. That is a security design issue, not a trivia footnote: if the exam stem cares about “analysts must not retrieve the storage key,” do not put an account key on the datastore. Use identity-based access instead.

Identity-based (often called credential-less) authentication stores only the account name and container or filesystem. At access time Azure Machine Learning uses:

The interactive user’s Microsoft Entra ID token (studio, notebooks, jobs submitted with UserIdentityConfiguration )

A managed identity on the workspace, compute cluster, compute instance, or serverless job

Grant Storage Blob Data Reader as the minimum data-plane role on Blob or ADLS Gen2. Writers need Storage Blob Data Contributor . ADLS Gen2 can go further with POSIX-like ACLs on folders. Control-plane Reader or Contributor on the storage account is not a substitute for the data-plane roles; a classic exam distractor is “the user is Contributor on the storage account, so the job can read blobs.” Contributor without a data-plane role often yields 403 on blob data.

  • Creating datastores with CLI v2 and SDK v2
  • Identity-based Blob datastore (preferred): # blob-identity.yml
  • $schema: https://azuremlschemas.azureedge.net/latest/azureBlob.schema.json
  • name: blob_claims_raw
  • type: azure_blob
  • account_name: stclaimsprod
  • container_name: raw az ml datastore create --file blob-identity.yml

The SDK v2 equivalent constructs AzureBlobDatastore(name=..., account_name=..., container_name=...) with no credentials= and calls ml_client.create_or_update(store) .

ADLS Gen2 identity-based YAML uses type: azure_data_lake_gen2 plus filesystem: instead of container_name . If the lake still requires a service principal, add credentials with tenant_id , client_id , and client_secret . Azure Files YAML uses type: azure_file , file_share_name , and credentials—there is no identity-based Files path.

URI paths in jobs then look like:

azureml://datastores/blob_claims_raw/paths/2026/claims.parquet

Jobs can also take raw wasbs:// or abfss:// URIs. Datastore URIs are preferred in MLOps because the authentication mode is defined once on the datastore, not in every job YAML.

Which identity actually reads the data?

Walk this list when a job cannot see files:

If the datastore has cached credentials , those credentials are used. User and compute identities are ignored.

If the datastore is identity-based and the job sets identity: type: user_identity , the submitting user’s Entra token is used. Studio does not support this mode for all job types; CLI/SDK v2 do. Fine-grained “this scientist can read folder A, that scientist can read folder B” is the reason to choose it.

Otherwise the compute managed identity (cluster, instance, or the user-assigned identity on a serverless job) is used. Admins grant Storage Blob Data Reader to /workspace-name/computes/compute-name so data scientists never receive personal data-plane roles. That is the usual production pattern for confidential data.

Interactive studio previews can use the workspace managed identity when you enable “use workspace managed identity for data preview and profiling.”

Serverless compute supports user credential passthrough and user-assigned managed identity . It does not support a system-assigned identity on the serverless job itself.

You cannot mix user identity and compute managed identity in the same job. For pipelines, set identity on the step , not only on the root pipeline—especially when the pipeline contains nested pipeline components.

Cross-tenant storage access is not supported. If the lake lives in another tenant, that is a support exception, not a datastore checkbox.

When credential-based is still the right answer

Identity-based is the default you should argue for. Credential-based still appears on the exam when:

  • The store is Azure Files (no identity-based option)
  • A partner system can only mint a time-boxed SAS

A central service principal is the only identity the storage firewall will allow, and compute identities cannot be added yet

Even then, keep the secret in the datastore (Key Vault) or in Azure Key Vault references used by jobs. Do not commit keys, and do not os.environ["AZURE_STORAGE_KEY"] = "..." in a notebook cell. Section 2.4 covers managed identities in more depth; the datastore rule is simple: if a managed identity can work, do not copy a key.

Storage firewalls change which identity is used for preview. If only listed subnets can reach the account, studio previews often use the workspace managed identity. If “allow Azure trusted services” is enabled, the workspace MSI is in play again. Identity-based datastores plus a locked storage firewall are compatible only when you also complete the network design (private endpoints or trusted services)—that pairing shows up again in Chapter 4.

Exam scenario

A bank keeps features in ADLS Gen2. The platform team refuses to put the storage account key in Azure Machine Learning because Reader and AzureML Data Scientist can list datastore secrets. Create an identity-based azure_data_lake_gen2 datastore. Grant the compute cluster’s managed identity Storage Blob Data Reader on the filesystem the training job needs. Data scientists keep AzureML Data Scientist on the workspace and never receive the account key.

Common trap

Two traps show up constantly. First, using workspaceblobstore as the project lake: snapshots and random uploads collide with production tables, and you inherit the default account’s SKU limits. Second, creating a credential-based Blob datastore “for convenience,” then assigning Reader to contractors—those contractors can view the cached key. Identity-based access plus data-plane RBAC avoids both.