Azure Machine Learning workspace assets and compute

AI-300 · Design and manage machine learning operations · Updated

MLOps starts with reusable, versioned building blocks. The exam asks which asset or compute type fits a requirement, so learn what each one is for.

Core workspace assets

AssetWhat it holdsKey point
EnvironmentDocker image plus conda/pip dependenciesVersioned; a change means a new version
Data assetPointer to data (uri_file, uri_folder, mltable)Data stays in storage; only the reference is versioned
ModelRegistered artifacts, often in MLflow formatRegister to version and deploy
ComponentReusable pipeline stepShare through a registry

Every asset has a name and a version. Assets are not edited in place; you create a new version.

Environments

Three ways to define one: a curated environment, an existing Docker image, or a Docker build context. With SDK v2:

from azure.ai.ml.entities import Environment
env = Environment(
    name="train-env",
    image="mcr.microsoft.com/azureml/openmpi4.1.2-ubuntu20.04",
    conda_file="conda.yml",
)
ml_client.environments.create_or_update(env)

Use image for a ready image, build for a Dockerfile folder, and conda_file to layer packages.

Data assets

A data asset type tells jobs how to read the data.

  • uri_file: one file.
  • uri_folder: a folder, for example all blobs in a container.
  • mltable: tabular data with a schema. In a notebook, load it with mltable.load() and then to_pandas_dataframe().

Paths can use azureml://datastores/... or https:// URIs.

Compute targets

TargetUse it for
Compute instanceOne data scientist, notebooks, interactive work
Compute clusterTraining jobs, scale to zero, low-priority VMs
Serverless computeJobs without managing a cluster
Kubernetes (AKS or Arc)Real-time inference on your own cluster
Managed online endpointFully managed real-time inference

Registries and model lifecycle

An Azure Machine Learning registry is a central place to share models, environments, components and data across workspaces and regions. To retire a model version that must stay available for compliance or rollback, archive it; deleting removes it.

In notebooks, use %pip install so packages go into the running kernel only. !pip can install into a different environment.

Exam traps

  • Editing an environment: you cannot; create a new version.
  • Compute instance versus compute cluster: instance is single-user dev, cluster is for scalable training.
  • Archive versus delete: archive keeps the model for audit and rollback.
  • Git sync across workspaces is not asset sharing; a registry is.
  • !pip versus %pip: only %pip targets the current kernel.

Practice questions

Choose an answer, then review the explanation to check your understanding.

1. You define an Azure Machine Learning environment with the Python SDK v2 from a Docker image that already exists in a registry. Which parameter do you set?

Show answer

Answer: B.The image parameter points to an existing Docker image. build is for a Docker build context, and conda_file adds conda dependencies on top of a base image.

2. A new version of a Docker image is available and the environment must use it. What should you do?

Show answer

Answer: B.Environments are versioned and immutable. Register a new version with create_or_update instead of editing the old one.

3. Models, components and environments must be reused across several workspaces without copying them, with central governance. What do you use?

Show answer

Answer: B.An Azure Machine Learning registry publishes assets once so many workspaces can consume them.

4. Which compute target gives you low-priority (discounted) VMs for training and can scale to zero when idle?

Show answer

Answer: B.A compute cluster scales between min and max nodes and supports low-priority (Spot) VMs. A compute instance is a single-user dev machine.

AI-300 course outline

All 4 lessons · Course overview
  1. Azure Machine Learning workspace assets and computeDesign and manage machine learning operations Free
  2. Secure workspaces and automate with CI/CDDesign and manage machine learning operations Free
  3. Training jobs, sweep tuning and MLflow trackingTrain and deploy models Full access
  4. Managed online endpoints and safe rolloutTrain and deploy models Full access