Design and Implement an MLOps Infrastructure · Topic 1 of 4

Workspaces, Datastores, Compute and Access

AI-300 MLOps: create a Machine Learning workspace, connect datastores, pick compute instance, cluster or serverless, and assign roles and identities.

  • 5 min
In a nutshell
  • A workspace needs storage, key vault and Application Insights; the container registry is optional and created on demand.
  • Datastores store connection details only; the data stays in the storage account.
  • Compute instance is for one user; a cluster autoscales; serverless needs no creation.

What it is

An Azure Machine Learning workspace is the top-level resource for machine learning work. It holds jobs, models, endpoints and assets, and it is also an MLflow tracking server. A workspace depends on a storage account, a key vault and an Application Insights instance. A container registry is optional and is created when it is first needed to build environment images.

Datastores are named references to storage, so jobs never contain raw connection strings. Compute targets run the work. Identities and roles decide who and what may touch all of it.

Workspacestorage, key vault, App InsightsDatastorespoint to blob, ADLS, filesComputeinstance, cluster, serverlessIdentityRBAC and managed identity

How it works

Create a workspace

# workspace.yml
$schema: https://azuremlschemas.azureedge.net/latest/workspace.schema.json
name: mlw-prod
location: eastus
display_name: Production ML workspace
description: Training and endpoints for the churn model
az extension add --name ml
az ml workspace create --file workspace.yml --resource-group rg-ml

In Python SDK v2, connect with MLClient(DefaultAzureCredential(), subscription_id, resource_group, workspace_name) and create a workspace with ml_client.workspaces.begin_create(Workspace(name="mlw-prod", location="eastus")).

Datastores

Datastore typeBacking service
Azure Blob containerBlob storage
Azure Data Lake Storage Gen2ADLS Gen2
Azure FilesFile share
OneLakeMicrosoft Fabric lakehouse

Every workspace gets default datastores, including workspaceblobstore (blob) and workspacefilestore (files). A datastore authenticates either with credentials (account key, SAS token, service principal) or with identity, where you save no secret and the user's or workspace's identity must hold a data role on the storage.

$schema: https://azuremlschemas.azureedge.net/latest/azureBlob.schema.json
name: raw_data
type: azure_blob
account_name: stmlrawdata
container_name: raw
az ml datastore create --file datastore.yml --workspace-name mlw-prod --resource-group rg-ml

Because no credentials appear in the file above, the datastore is identity based. The identity needs Storage Blob Data Reader (read) or Storage Blob Data Contributor (write) on the container.

Compute targets

ComputeUse it forKey points
Compute instanceOne data scientist's workstation: notebooks, VS Code, terminalSingle user, you pay while it runs, can use an idle shutdown or a schedule
Compute clusterTraining jobs and batch scoringMulti node, autoscales between a minimum and maximum, set minimum to 0 to pay nothing when idle
Serverless computeJobs with no cluster to manageYou name the instance type and count in the job; no creation step
Kubernetes / attached computeExisting AKS or Arc clusters, other attached resourcesYou manage the cluster
$schema: https://azuremlschemas.azureedge.net/latest/amlCompute.schema.json
name: cpu-cluster
type: amlcompute
size: STANDARD_DS3_V2
min_instances: 0
max_instances: 4
idle_time_before_scale_down: 120
tier: low_priority

tier: low_priority uses cheaper preemptible VMs that can be taken away, so it suits fault tolerant training that writes checkpoints. A job can request serverless compute by omitting compute and setting resources with instance_type and instance_count.

Identity and access

Access is controlled with Azure RBAC at the workspace.

RoleWhat it can do
Owner / ContributorFull management, including creating compute and the workspace itself
AzureML Data ScientistRun experiments, create and deploy models and endpoints; cannot create or delete compute or change the workspace
AzureML Compute OperatorCreate and manage compute resources
ReaderView only

Identities come in three kinds: the user (Microsoft Entra ID), the workspace managed identity (used to reach storage, Key Vault and the registry), and compute managed identities (system or user assigned) that jobs use to read data. Prefer managed identities over keys, and give each one only the data role it needs.

A worked example

A team wants nightly training that reads a private data lake and costs nothing when idle. They create an ADLS Gen2 datastore with no credentials, a cluster with min_instances: 0 and a user assigned managed identity, and grant that identity Storage Blob Data Reader on the lake. Analysts get AzureML Data Scientist so they can submit jobs but cannot delete the cluster.

How the exam asks about this

  • "Analysts must submit jobs but not create or delete compute." Assign AzureML Data Scientist.
  • "Training must not incur cost when no jobs run." A compute cluster with minimum instances 0.
  • "Remove stored keys from the datastore." Use identity based access and grant a storage data role.

What to remember for the exam

  • A workspace needs storage, key vault and Application Insights; the container registry is optional and created on demand.
  • Datastores store connection details only; the data stays in the storage account.
  • Compute instance is for one user; a cluster autoscales; serverless needs no creation.
  • AzureML Data Scientist cannot create compute; AzureML Compute Operator can.
  • Identity based datastore access needs a Storage Blob Data role on the account.
Watch out

Storage account keys and SAS tokens in a datastore work but are a security smell. Exam answers prefer identity based access.

Common mistakes

Giving everyone Contributor. Contributor can change the workspace and compute. Use AzureML Data Scientist for people who only run work.

Leaving a compute instance running. It bills while running. Use an idle shutdown or schedule, and use a cluster for training.

Expecting a datastore to copy data. It is only a pointer, so the identity still needs rights on the storage.

Check yourself

  • Which compute type autoscales to zero nodes when idle?

    A compute cluster with min_instances set to 0.

  • Which built in role runs experiments but cannot create compute?

    AzureML Data Scientist.

  • What does a datastore without credentials rely on?

    Identity based access, so the user or managed identity needs a Storage Blob Data role.

Topic 1 of 4 in Design and Implement an MLOps Infrastructure

Test yourself on Design and Implement an MLOps Infrastructure

The full Microsoft AI-300 question bank has 650 questions, with timed practice exams and an explanation for every answer.

This study guide is independent and is not affiliated with, endorsed by, or sponsored by Microsoft. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.