Study Guide · AI-300

AI-300 Cheat Sheet

189 entries · 14 chapters · 5 domains

Design and implement an MLOps infrastructure

Machine Learning Workspace Resources

Read full chapter

Cheat sheet

Sharp facts the exam loves — scan these before test day.

The workspace is the top-level Azure ML resource created first

The Azure Machine Learning workspace is the top-level resource and the centralized place where teams collaborate and where assets (datasets, models, components, environments, and jobs) are created and stored. Because every other Azure ML task (registering data or models, running jobs, creating endpoints) happens inside a workspace, a shared workspace must be provisioned first.

Trap A Microsoft Foundry project is for building generative AI apps and agents, not the top-level container for classic Azure ML training assets, so it does not replace the workspace.

14 questions test this
Workspace auto-provisions its associated Azure resources

If you do not supply them, creating a workspace automatically provisions the associated resources it depends on: an Azure Storage account and an Azure Key Vault, plus Application Insights for endpoint monitoring. An Azure Container Registry (ACR) is created lazily, only the first time you build a custom Docker image.

Trap ACR is not always created up front; a workspace can exist without an ACR until a custom environment image is built.

13 questions test this
Hub workspaces centralize governance across projects

A hub workspace groups multiple project workspaces under shared security settings, connections, and compute; it is the same resource type as a Microsoft Foundry hub, so it can be used from both Azure ML studio and Foundry. A workspace cannot be moved to a different subscription or tenant.

A datastore references existing storage and secures its credentials

A datastore is a reference to an existing Azure storage service; it does not create or copy the storage. It securely keeps the connection information and credentials in the workspace so scripts connect by a friendly datastore name instead of embedding storage connection strings and secrets in code.

Trap A datastore does not hold the data itself; it stores a pointer plus credentials to the underlying Blob, ADLS, or File storage.

12 questions test this
Datastore storage types and credential options

Datastores connect to Azure Blob Storage, Azure Data Lake Storage Gen2, Azure Files, and OneLake (Microsoft Fabric). Each is authenticated with an account key, a SAS token, or a service principal, or created credential-less for identity-based (Microsoft Entra) access. Data Lake Storage Gen1 datastores retired in February 2024.

Trap A credential-less (identity-based) datastore uses the caller's Entra identity at access time rather than a stored account key or SAS token.

10 questions test this
workspaceblobstore is the default datastore

Every workspace is created with built-in default datastores; workspaceblobstore is the default that Azure ML uses when you upload data or write job outputs (path form azureml://datastores/workspaceblobstore/paths/...). Create additional datastores with az ml datastore create --file .

Trap Uploaded data and job outputs land in workspaceblobstore by default; you do not have to create a datastore first to start working.

4 questions test this
Autoscaling compute clusters isolate jobs and scale to zero

An Azure ML compute cluster (AmlCompute) autoscales between its minimum and maximum node counts, provisioning dedicated nodes per submitted job (so workloads stay isolated) and de-allocating back to the minimum when idle. Setting the minimum node count to 0 means you pay nothing between runs.

Trap A fixed-size cluster (minimum nodes greater than 0) keeps billing while idle; only autoscale-to-zero satisfies both per-job isolation and zero idle cost.

8 questions test this
Compute clusters support low-priority (Spot) VMs

A compute cluster can be set to the low-priority (Spot) VM tier to run training and batch workloads on Azure surplus capacity at a steep discount. Compute instances, Azure Container Instances, and AKS inference do not offer a low-priority tier.

Trap Low-priority/Spot discounting applies to training and batch compute clusters, not to AKS or ACI real-time inference.

7 questions test this
Match the compute target type to the workload

A compute instance is a single-node managed dev workstation for one user (with idle shutdown); a compute cluster (AmlCompute) is multi-node autoscaling training and batch compute; managed online endpoints run on Microsoft-managed compute; attached Kubernetes (AKS or Arc) serves high-scale production inference; serverless compute is Microsoft-managed with no cluster to create.

Trap A compute instance is for interactive development, not distributed training or production serving.

20 questions test this
Serverless compute runs training jobs with no cluster and quota-aware VM sizing

Serverless compute is a fully managed, on-demand compute that Azure Machine Learning creates, scales, and tears down for you, so there is no cluster to create or manage. You run a command, sweep, or AutoML job on it simply by omitting the compute parameter (for a pipeline job, set default_compute to "serverless"), and if you also leave out resources it defaults the instance count and picks an instance_type using your quota, cost, performance, and disk size, so it selects an appropriate VM size from your quota to avoid insufficient-quota failures.

Trap Reaching for a compute cluster, Azure Container Instances, AKS, or local compute for a 'run training jobs without provisioning or managing infrastructure' scenario; omitting the compute target to use serverless is the no-management answer, and it consumes the same Azure ML compute quota with no min/max node cluster to size.

8 questions test this
Built-in AzureML RBAC roles

Azure ML provides built-in roles: AzureML Data Scientist can perform all workspace actions except creating/deleting compute or modifying the workspace itself; AzureML Compute Operator can create, manage, delete, and access compute; plus Reader, Contributor, and Owner. Combine AzureML Data Scientist and AzureML Compute Operator to let a user run experiments and self-serve compute.

Trap Granting Owner or Contributor over-privileges a data scientist; AzureML Data Scientist is the least-privilege built-in role for running experiments.

9 questions test this
The workspace uses a managed identity for dependent resources

The workspace uses a managed identity (system-assigned by default, or user-assigned) to reach its dependent resources such as storage, key vault, and ACR. For workspaces created after 2024-11-19 that identity is granted the Azure AI Administrator role on the resource group, which is narrower (least-privilege) than the older Contributor default.

Trap Prefer scoped Azure RBAC roles and the workspace managed identity over embedding credentials or granting broad Contributor access.

12 questions test this

Machine Learning Workspace Assets

Read full chapter
  • Data assets have three types: uri_file, uri_folder, mltable
  • Data asset versions are immutable; you archive, not delete
  • Jobs mount or download data assets to compute
  • Environments encapsulate the reproducible software runtime
  • Curated versus custom environments
  • Components are the reusable building blocks of pipelines
  • Command components are defined in YAML and registered
  • Registries share and promote assets across workspaces
  • AzureML Registry User role scopes registry access

Unlock with Premium — includes all practice exams and the complete study guide.

Infrastructure as Code for Machine Learning

Read full chapter
  • OIDC federated identity is the secure GitHub-to-Azure auth
  • azure/login with OIDC needs id-token write permission
  • Deploy the workspace resource type with Bicep
  • az ml (CLI v2) versus az deployment for provisioning
  • GitHub Actions workflows live in .github/workflows and are event-triggered
  • One workflow can chain provisioning, training, and deployment
  • Managed virtual network isolation modes
  • Private endpoints plus disabling public access lock down the workspace
  • Compute instances integrate Git and jobs capture Git lineage

Unlock with Premium — includes all practice exams and the complete study guide.

Implement machine learning model lifecycle and operations

Orchestrate Model Training

Read full chapter

Cheat sheet

Sharp facts the exam loves — scan these before test day.

MLflow is Azure ML's native experiment-tracking framework

Azure Machine Learning uses MLflow as its native tracking framework. A job run on Azure ML compute automatically has its MLflow tracking URI set to the workspace, so parameters, metrics, and artifacts logged with mlflow.log_param / mlflow.log_metric are stored in the workspace and shown on the job's Metrics tab.

Trap Assuming you must stand up and configure a separate MLflow tracking server; the Azure ML workspace already IS the tracking backend.

7 questions test this
mlflow.autolog() auto-captures params, metrics, and the model

Calling mlflow.autolog() before training enables automatic logging of parameters, metrics, and the trained model artifact for supported frameworks (scikit-learn, PyTorch, TensorFlow, XGBoost) without writing explicit log calls for each value.

Trap Believing you must hand-log every metric; autolog captures the standard framework metrics automatically.

6 questions test this
Interactive runs off Azure ML compute need the tracking URI set

Code running outside Azure ML managed compute (for example on a local machine) does not inherit the workspace tracking URI. You point MLflow at the workspace with mlflow.set_tracking_uri() so those runs are also recorded in the workspace.

AutoML supports five task types and optimizes a primary metric

Automated ML explores algorithms and hyperparameters in parallel for classification, regression, time-series forecasting, computer vision, and NLP tasks. You set the task type and a primary_metric (for example accuracy, AUC_weighted, or normalized_root_mean_squared_error) that AutoML optimizes to pick the best model.

Trap Thinking AutoML only handles classification; it also covers regression, forecasting, vision, and NLP.

5 questions test this
AutoML runs featurization automatically by default

In an AutoML job, featurization (scaling and normalization, missing-value handling, text-to-numeric encoding) runs automatically by default, and those steps become part of the produced model so they are reapplied at inference. You can set featurization to custom to override the defaults.

Trap Assuming you must manually engineer and encode all features first; AutoML featurizes automatically unless you customize it.

3 questions test this
AutoML stops on configurable exit criteria

An AutoML job ends when it meets the exit criteria you configure, such as experiment_timeout_minutes, max_trials (iterations), or a metric score threshold. Voting and stacking ensemble models are enabled by default and usually appear as the final trials.

Trap Expecting AutoML to run indefinitely; it halts at the timeout, trial cap, or score threshold you set.

4 questions test this
Notebooks run on a compute instance

Interactive experimentation and notebooks run on an Azure Machine Learning compute instance, a managed single-node cloud workstation (personal to one user) with Jupyter, JupyterLab, and VS Code. You start and stop it, and you can configure idle shutdown to avoid paying while it sits unused.

Trap Trying to open notebooks directly on a compute cluster; clusters run submitted jobs, not the interactive notebook environment.

8 questions test this
Compute instance vs compute cluster

A compute instance is single-node and stays running while started, for interactive authoring; a compute cluster (AmlCompute) is multi-node, autoscales dedicated nodes per submitted job, and can scale to 0 nodes when idle. Use the instance for notebooks and the cluster for training jobs and sweeps.

Trap Picking a cluster for interactive dev, or an instance for a distributed multi-node training job.

8 questions test this
Idle shutdown and start/stop schedules are how you stop paying for an idle compute instance

A compute instance is a single dedicated VM that keeps billing compute hours the whole time it is running and does not scale to zero like a compute cluster, so its main cost control is enabling idle shutdown (set idle_time_before_shutdown_minutes; the inactivity window must be at least 15 minutes and at most 3 days) and attaching start/stop schedules (up to four per instance). It only counts as inactive when there are no running kernels, terminals, jobs, VS Code connections, or custom apps.

Trap Expecting a compute instance to auto-scale to zero when idle like a compute cluster; it keeps billing until idle shutdown or a schedule stops it.

7 questions test this
Sweep jobs sample a search space with grid, random, or bayesian

A sweep job automates hyperparameter tuning by exploring a defined search space with a sampling algorithm: random, grid, or bayesian sampling. You also set a primary_metric plus its goal (maximize or minimize) that the sweep optimizes across trials.

Trap Choosing grid sampling for a large or continuous search space, where random or bayesian sampling is far more efficient.

6 questions test this
Early-termination policies cancel poorly performing trials

To cut cost, a sweep job can apply an early-termination policy that cancels underperforming trials early: bandit (slack_factor or slack_amount off the best run), median_stopping, or truncation_selection. Policies use evaluation_interval and delay_evaluation to control when they start acting.

Trap Confusing bandit's slack (distance from the best run) with truncation selection's fixed percentage of worst trials.

8 questions test this
Bayesian sampling does not support early termination

Bayesian sampling chooses each new set of hyperparameter values from the results of prior trials and does NOT support early-termination policies (set the policy to None). Random and grid sampling do support early termination.

Trap Pairing bayesian sampling with a bandit or median-stopping policy; only random and grid sampling allow early termination.

4 questions test this
A command job runs a training script on a compute target

You run a training script as a command job that specifies the command (for example python train.py), the code folder, an environment (a curated or custom Docker/conda image), and a compute target. Submit it with az ml job create -f job.yml.

Trap Confusing environment with compute; a command job needs both an environment (dependencies) and a compute target (hardware).

7 questions test this
Typed inputs/outputs bind data to the job

A command job's inputs mount or download data assets and URIs into the script, and its outputs write results back to workspace-managed storage. You reference them in the command with ${{inputs.}} and ${{outputs.}} placeholders instead of hardcoding storage paths.

Trap Hardcoding blob/datastore paths in the script rather than using typed inputs/outputs, which breaks portability and lineage.

9 questions test this
Distribution config scales training across nodes

To train large or deep-learning models across multiple nodes, a command job sets a distribution with type pytorch, tensorflow, or mpi (for example Horovod), together with instance_count (number of nodes) and process_count_per_instance (processes or GPUs per node).

Trap Setting instance_count greater than 1 without a distribution config; the workers then run independently instead of coordinating.

9 questions test this
process_count_per_instance usually equals GPUs per node

process_count_per_instance is typically set to the number of GPUs on each node, and scaling out with a larger instance_count requires a compute cluster whose VM SKU provides those GPUs.

Distribution type must match the training framework

Set distribution.type (or use the typed PyTorchDistribution, TensorFlowDistribution, or MpiDistribution object) to match the framework the script uses: PyTorch for torch.distributed/DistributedDataParallel scripts, TensorFlow for tf.distribute (using worker_count, plus parameter_server_count for the parameter-server strategy), and mpi for MPI or Horovod. DeepSpeed is not a separate distribution type; you launch it through either the PyTorch or the MPI distribution.

Trap Selecting mpi for a plain PyTorch DistributedDataParallel script, which needs the PyTorch type, or treating DeepSpeed as its own distribution.type instead of launching it through the PyTorch or MPI distribution.

7 questions test this
A training pipeline chains reusable components

A training pipeline is a pipeline job made of components, where each component is a self-contained step with typed inputs/outputs, an environment, and code. Components are registered, versioned assets that can be reused across pipelines and shared, and each step can run on its own compute.

Trap Treating a standalone command job as reusable; the component is the registerable, shareable unit that pipeline steps consume.

11 questions test this
Pipeline steps can reuse unchanged outputs

Azure ML can reuse a prior step's cached output when that component's code and inputs are unchanged, skipping recomputation to save time and cost on subsequent pipeline runs.

Compare metrics across runs to choose the best model

Because each run logs metrics to the workspace via MLflow, you compare model performance across jobs by selecting multiple runs in an experiment and viewing their logged metrics side by side in the studio (or querying them with the MLflow API) to identify the best model.

Trap Comparing on training loss instead of the agreed primary/validation metric used to select the production candidate.

9 questions test this
Sweep and AutoML surface the best trial by primary_metric

AutoML and sweep jobs already rank trials by the configured primary_metric and surface the single best trial, so choosing a production candidate means taking that best trial's model rather than manually re-ranking every run.

Trap Re-picking a model by a different metric than the primary_metric the job optimized, which can select a worse model.

8 questions test this

Model Registration and Versioning

Read full chapter
  • Register a model directly from a run's output artifacts
  • MLflow model type enables no-code deployment
  • Registering under an existing name increments the version
  • Promote a registered model version across workspaces through a registry
  • Archiving hides a model version but retains it
  • There is no delete/unregister for a registered model version
  • feature_retrieval_spec.yaml is packaged at the model artifact root
  • Feature store serves an offline and an online store
  • Interpretability produces feature-importance for prediction transparency
  • The Responsible AI dashboard bundles several evaluation components
  • The Responsible AI error-analysis component locates high-error cohorts on any feature
  • Fairness evaluates error/selection rates across sensitive cohorts
  • ThresholdOptimizer mitigates unfairness without retraining

Unlock with Premium — includes all practice exams and the complete study guide.

Deploy Models for Production

Read full chapter
  • Managed online endpoints serve low-latency real-time inference
  • Endpoint and deployment are separate objects
  • Autoscale a managed online deployment through Azure Monitor autoscale rules
  • Managed online endpoints support key, AML-token, and Entra-token auth modes
  • Custom-model deployments need a score.py plus environment; MLflow deploys no-code
  • Kubernetes online endpoints give infrastructure control but lose traffic mirroring and out-of-box Azure Monitor monitoring
  • Batch endpoints run asynchronous large-volume scoring
  • Batch deployment settings control scoring parallelism
  • Invoke to test, get-logs to troubleshoot a deployment
  • Local endpoints validate a deployment before the cloud
  • Blue/green rollout shifts traffic percentage gradually
  • Rollback is an instant traffic shift to the prior deployment
  • Mirror traffic shadow-tests a candidate deployment

Unlock with Premium — includes all practice exams and the complete study guide.

Monitor and Maintain Models

Read full chapter
  • Data drift compares production data against a reference
  • Monitoring requires production data collection on the deployment
  • Out-of-box monitoring tracks three signals; feature attribution drift is advanced
  • Feature importance focuses monitoring on the most influential features
  • Traffic-category metrics report endpoint health
  • Match the endpoint metric to the signal you need
  • Deployment-scope Resource metrics drive autoscale and reveal compute saturation
  • Monitoring alerts when a metric exceeds its threshold
  • Wire alerts to trigger a retraining pipeline
  • Azure ML Schedules run a pipeline job on a recurrence or cron cadence, with no event-based triggers
  • Azure ML publishes workspace lifecycle events to Event Grid for event-driven retraining

Unlock with Premium — includes all practice exams and the complete study guide.

Design and implement a GenAIOps infrastructure

Foundry Environments and Platform Configuration

Read full chapter

Cheat sheet

Sharp facts the exam loves — scan these before test day.

Foundry project is the default; a hub-based project is only for Azure ML / open-model workloads

Microsoft Foundry offers two project types. A Foundry project is the default, generally available choice and the only one that exposes the Foundry API and Foundry Agent Service; a hub-based project is required only when you need Azure Machine Learning compatibility, managed compute, or open-source model hosting and fine-tuning.

Trap Choosing a hub-based project 'to use prompt flow' — prompt flow is on a retirement path (support ends 2027-04-20), so it is not a reason to pick a hub project for new work.

14 questions test this
The Foundry resource is the top-level Azure resource that contains projects

A Microsoft Foundry resource is the top-level Azure resource you create first; projects are child scopes inside it that group models, agents, connections, and deployments. The Azure Machine Learning workspace remains the top-level resource for classic ML assets, not for generative AI work.

Trap Treating the Azure Machine Learning workspace as the container for Foundry generative-AI projects.

8 questions test this
A connection stores authentication to an external resource for reuse across a project

A Foundry connection is a named, project-scoped object that stores the endpoint and credentials for an external dependency such as Azure Storage, Azure AI Search, or Application Insights, so components and agents reuse the connection instead of embedding secrets in each definition.

Trap Hard-coding a resource key into each agent or prompt rather than referencing one shared connection.

27 questions test this
A connection can authenticate with an Entra identity instead of a key

A Foundry connection can authenticate to its target resource with a Microsoft Entra identity (the resource's managed identity) rather than an API key, keeping secrets out of the connection object and letting Azure RBAC govern who can use it.

System-assigned vs user-assigned managed identity for a Foundry resource

A Foundry resource can use a system-assigned managed identity (created and deleted with the resource, one-to-one) or a user-assigned managed identity (a standalone Azure resource you can attach to several resources and manage independently) to access dependencies such as Storage or Key Vault without stored credentials.

Trap Using an account key or SAS token where a managed identity is required for keyless, credential-free access.

12 questions test this
Prefer Microsoft Entra (keyless) authentication over API keys

For production Foundry access, Microsoft Entra ID token authentication with a managed identity is preferred over API keys; you can disable local (key) authentication so every data-plane call is authorized through Entra ID and RBAC rather than a shared secret.

Trap Assuming API keys are as safe as Entra ID — keys cannot be scoped by RBAC and are harder to rotate or revoke per user.

12 questions test this
Foundry User grants the minimum permissions to use a project and its models

The built-in Foundry User role (formerly Azure AI User) grants the least-privilege access needed to work inside a project and call its deployed models; assign it to team members who build and test rather than granting a broad Owner or Contributor role.

Trap Granting Owner or Contributor for everyday build-and-test work, over-provisioning access beyond what Foundry User already allows.

13 questions test this
Foundry Project Manager is the elevated build role whose distinctive power is publishing agents

The Foundry Project Manager role (formerly Azure AI Project Manager) is the elevated developer role: it is the minimum role that can publish agents (Foundry Account Owner cannot publish) and it can conditionally assign the Foundry User role to others. Microsoft pages currently disagree on whether it can also create projects or manage model deployments - the canonical rbac-foundry matrix (2026-07) marks both as NOT granted - so questions must not anchor on those claims; Foundry Account Owner and Foundry Owner cover full resource management and model deployment.

Trap Assuming Project Manager can create projects or deploy models; the canonical RBAC matrix denies both, and its distinctive documented power is agent publishing plus conditional Foundry User assignment.

8 questions test this
Managed VNet isolation modes: Allow internet outbound vs Allow only approved outbound

A Foundry managed virtual network supports two isolation modes: Allow internet outbound (agents may reach public endpoints) and Allow only approved outbound (outbound is limited to approved private endpoints and FQDN rules). Only Allow only approved outbound enables automatic data-exfiltration protection, and adding an outbound FQDN rule automatically provisions an Azure Firewall.

Trap Believing Allow internet outbound provides data-exfiltration protection — only Allow only approved outbound does.

15 questions test this
Use a private endpoint and disable public network access to reach Foundry privately

To keep traffic off the public internet, create a private endpoint for the Foundry resource and set public network access to Disabled, so the resource is reachable only over a private IP inside your virtual network. Managed private endpoints created by the managed VNet are fully Microsoft-managed and do not expose a customer-visible network interface (NIC).

Trap Using a service endpoint instead of a private endpoint, or leaving public network access enabled after adding the private endpoint.

16 questions test this
Provision Foundry resources repeatably with Bicep templates and Azure CLI

Define Foundry resources, projects, and model deployments as Bicep templates and deploy them with the Azure CLI (for example az deployment group create) so environments are versioned, reviewable, and reproducible. A managed-network Foundry resource currently has no portal creation UI and must be deployed via Bicep or Terraform, or with az rest / Azure CLI.

Trap Relying on portal click-ops, which is not source-controlled or repeatable across dev/test/prod environments.

21 questions test this

Deploy and Manage Foundation Models

Read full chapter
  • Serverless API deployment bills per token and needs no compute quota
  • Managed compute uses dedicated VMs, needs compute quota, and bills hourly while running
  • Standard deployments are best-effort per-token; Provisioned reserve capacity
  • Global routes anywhere; Data Zone keeps processing within a geography
  • A deployment content filter tunes four harm categories and severity thresholds plus blocklists and Prompt Shields against direct jailbreak and indirect (XPIA) prompt injection
  • Standard deployments draw a per-deployment TPM quota from a region-subscription pool
  • Global Batch is the cost-optimal deployment type for high-volume asynchronous workloads
  • Protected-material text and code are output-only content filters, on by default, and separate from the ProtectedMaterial evaluator
  • Use the model leaderboard to compare quality, safety, cost, and throughput
  • The catalog spans many model providers
  • Match the model class to the workload before comparing individual models
  • Model router auto-selects the best underlying model per prompt
  • Three deployment version-upgrade options control model updates
  • Automatic updates apply to Standard only; Provisioned migrates manually
  • GA models get at least 60 days' retirement notice
  • PTUs reserve fixed capacity billed hourly regardless of tokens
  • Spillover routes overflowing PTU requests to a paired standard deployment
  • Provisioned Throughput Reservations discount committed PTUs for a fixed term

Unlock with Premium — includes all practice exams and the complete study guide.

Prompt Versioning and Source Control

Read full chapter
  • A prompt's system message and instructions define agent behavior and grounding
  • Store prompts as code assets in a Git repository
  • A repo structure separates prompt versions and environments
  • Compare prompt versions with Foundry evaluations on a fixed dataset
  • Prompt flow is retiring; build new prompt and agent orchestration on Agent Framework
  • Define agents and prompts as configuration and promote them through CI/CD
  • Choose a prompt agent or a hosted agent to operationalize an agent
  • Hosted-agent deployment lifecycle: versioned deploys, auto identity, tracing, and scale-to-zero

Unlock with Premium — includes all practice exams and the complete study guide.

Implement generative AI quality assurance and observability

Evaluation and Validation for Generative AI

Read full chapter

Cheat sheet

Sharp facts the exam loves — scan these before test day.

The evaluate() API takes a dataset file path, standardly JSONL

The Azure AI Evaluation SDK evaluate() API takes a test dataset as a file path, not as an in-memory list or a plain JSON array. JSON Lines (JSONL, one JSON object per line) is the standard format used throughout the documentation and tooling, and the current API reference also accepts CSV; each record supplies the fields the chosen evaluators need.

Trap Assuming evaluate() ingests an in-memory Python list or a plain JSON array file; it requires a dataset file path (JSONL standard).

5 questions test this
Evaluation records carry query, response, context, and ground_truth

An evaluation record can contain up to four elements: query (the input sent to the app), response (the app output), context (the grounding/source documents), and ground_truth (a human reference answer). Which are required depends on the evaluator; groundedness and relevance need context, while similarity and F1 need ground_truth.

Trap Omitting context for a groundedness run or ground_truth for a similarity run, so the evaluator scores against empty input.

9 questions test this
column_mapping aligns dataset columns to evaluator inputs

When dataset column names differ from the keywords an evaluator expects, you map them with column_mapping inside evaluator_config, using ${data.} to reference a dataset field and ${outputs.} to reference a value produced by a target; a default mapping applies to all evaluators. Comprehensive evaluation is achieved by mapping every required field for each evaluator.

Trap Assuming columns must literally be named query/response; mismatched names without a column_mapping feed the evaluator empty values.

6 questions test this
Simulator generates non-adversarial synthetic evaluation data

The azure.ai.evaluation.simulator.Simulator class produces non-adversarial synthetic query/response conversations from a text blob or search index, giving consistent, repeatable evaluation inputs when no production data exists. It is the tool for building a controlled dataset to compare prompt variants without live user traffic.

Trap Reaching for content filters or a blocklist to create evaluation inputs; those moderate content, they do not generate a controlled test dataset.

13 questions test this
AdversarialSimulator builds red-team safety datasets and needs a Foundry project

AdversarialSimulator, driven by an AdversarialScenario enum, generates adversarial (red-team) datasets using a service-hosted model with safety behaviors turned off; it requires a Foundry project and runs only in East US 2, France Central, UK South, and Sweden Central. DirectAttackSimulator produces user-prompt (UPIA) jailbreak data and IndirectAttackSimulator produces cross-domain (XPIA) jailbreak data.

Trap Expecting adversarial simulation to run in any region; the hosted safety service is limited to four regions and needs azure_ai_project.

11 questions test this
Groundedness, relevance, coherence, and fluency are the core AI quality metrics

Groundedness, relevance, coherence, and fluency are the AI-assisted quality evaluators. Groundedness and relevance are RAG-oriented (groundedness checks the response against supplied context; relevance checks the response against the query), while coherence and fluency are general-purpose language-quality metrics — coherence scores how well the response hangs together as an answer to the query (requires query + response), whereas only fluency judges the response text alone.

Trap Selecting groundedness when no context/grounding documents are provided; without context there is nothing to measure groundedness against.

8 questions test this
Quality evaluators use an LLM judge and a 1-5 Likert score

AI-assisted quality evaluators use an LLM-as-a-judge, so you must supply a GPT model deployment in model_config (AzureOpenAIModelConfiguration). They score on a 1-to-5 Likert scale where higher is better, apply a default pass threshold of 3, and return a reason for the score.

Trap Configuring a model_config for the risk and safety evaluators; only the AI-assisted quality/RAG evaluators use a GPT judge, safety evaluators do not.

7 questions test this
GroundednessPro uses the hosted safety service, not a GPT judge

GroundednessProEvaluator (preview) detects ungrounded or hallucinated claims using the hosted Foundry evaluation service, so it takes azure_ai_project rather than a GPT model_config and returns a pass/fail label with a reason instead of a 1-to-5 score.

Textual-similarity NLP evaluators score token/n-gram overlap against a supplied ground truth and need no LLM judge

The textual-similarity evaluators (F1Score, BleuScore, GleuScore, RougeScore, MeteorScore) are built-in, generally available metrics that score a response purely by math-based token or n-gram overlap against a supplied ground_truth, so they take only ground_truth plus response and require no GPT model deployment or LLM-as-a-judge (each returns a 0-1 float against a default 0.5 threshold, except RougeScore, which returns separate precision, recall, and F1 scores). The selection rule is deterministic: when a fixed reference answer exists and exact overlap is the criterion (machine translation, fixed-answer retrieval, NLP benchmarking) choose a textual-similarity evaluator; when there is no ground truth to compare against, choose the AI-assisted quality metrics (groundedness, relevance, coherence, fluency) instead.

Trap Reaching for an AI-assisted quality evaluator, or supplying a model_config, when a fixed ground_truth answer already exists — the textual-similarity evaluators need no LLM-judge deployment; conversely, they cannot run at all without a ground_truth.

7 questions test this
Safety evaluators run in the hosted service and need azure_ai_project

The risk and safety evaluators (ViolenceEvaluator, SexualEvaluator, SelfHarmEvaluator, HateUnfairnessEvaluator) are executed by the hosted Microsoft Foundry evaluation service, so they are instantiated with your Foundry project information (azure_ai_project) and a credential, not with a GPT model_config or a deployment_name.

Trap Passing a GPT model_config to a safety evaluator; harm detection is done by Microsoft-hosted safety models reached through your Foundry project.

5 questions test this
Content safety uses a 0-7 severity scale with a default threshold of 3

Content safety evaluators return a 0-to-7 severity score bucketed as Very low (0-1), Low (2-3), Medium (4-5), and High (6-7). Given a default threshold of 3, a score at or below the threshold passes and a higher score fails, with a reason explaining the level.

Trap Reading the safety scale like a quality score; here a HIGHER number means MORE harmful, the opposite of the 1-to-5 quality metrics.

6 questions test this
Safety results aggregate into a defect rate; ContentSafetyEvaluator bundles the four harms

Over a dataset the service reports a defect rate, the percentage of responses whose severity exceeds the threshold, as the aggregate safety signal. ContentSafetyEvaluator is a composite evaluator that runs violence, sexual, self-harm, and hate/unfairness together for a single combined output.

Trap Reporting a single worst-case score instead of the defect rate, which is the intended dataset-level harmful-content metric.

6 questions test this
The safety evaluation service is region-limited

The hosted safety evaluation service (and adversarial simulation) is available only in select regions, so the Foundry project must be created in a supported region such as East US 2, France Central, UK South, or Sweden Central for these evaluators to run.

IndirectAttack and ProtectedMaterial are pass/fail risk evaluators beyond the four harms

Beyond the four content-harm evaluators, the built-in risk and safety set includes IndirectAttack (XPIA / cross-domain prompt injection), which returns a boolean pass/fail verdict where fail means the response fell for a jailbreak instruction injected into retrieved context or a source document, and ProtectedMaterial, which flags text under copyright (song lyrics, recipes, articles) using the Azure AI Content Safety Protected Material for Text service. Both output pass/fail rather than the 0-to-7 severity score used for hate/unfairness, sexual, violence, and self-harm.

Trap Assuming every risk and safety evaluator emits a 0-to-7 severity score, or that IndirectAttack inspects the user's direct prompt; it is a boolean verdict and targets injections hidden in retrieved or grounding content, not the immediate user turn.

The AI Red Teaming Agent automates adversarial scans into an ASR risk-category scorecard

The AI Red Teaming Agent (preview) is Microsoft Foundry's automated adversarial-scanning tool, built on the open-source PyRIT framework, that probes a model, application, or agent endpoint with simulated attacks (applying PyRIT attack strategies such as Base64, Flip, or Crescendo across easy, moderate, and difficult complexity), scores each attack-response pair with the hosted Risk and Safety Evaluators, and reduces the run to an Attack Success Rate (ASR), the percentage of attacks that successfully elicit an undesirable response. It emits a risk-category scorecard broken down by harm category and attack complexity to drive a pre-deployment go/no-go decision, and is distinct from the AdversarialSimulator, which only generates a red-team dataset, and from the hosted per-response safety evaluators, which score a single response at a time rather than run an end-to-end attack campaign.

Trap Confusing the AI Red Teaming Agent with the AdversarialSimulator (which only builds the adversarial dataset) or with the hosted content-safety evaluators (which score the harm severity of one response); the AI Red Teaming Agent runs the whole scan, scoring attack-response pairs into the ASR scorecard used for the deployment go/no-go.

4 questions test this
evaluate() runs many evaluators over one dataset and can log to Foundry

The evaluate() API runs multiple built-in and custom evaluators over one dataset in a single pass, returning aggregate metrics plus per-row scores, and can log results to a Foundry project (surfaced via result.studio_url). Composite evaluators such as QAEvaluator bundle several quality metrics at once.

Trap Running each evaluator by hand row by row; evaluate() batches all evaluators and produces the aggregated report.

9 questions test this
Custom evaluators are code-based callables or prompt-based Prompty files

When built-in metrics do not fit, you author custom evaluators either as a code-based Python callable/class (for example a deterministic score like answer length) or as a prompt-based Prompty file that instructs a judge model, then pass them to evaluate() alongside the built-in evaluators.

Trap Assuming only built-in metrics exist; domain-specific criteria are handled by code-based or Prompty custom evaluators.

7 questions test this
Cloud evaluation wires evaluations into CI/CD as automated quality gates

Cloud (remote) evaluation runs let you integrate evaluation into CI/CD pipelines such as GitHub Actions as automated quality gates, failing a build or blocking a release when quality or safety scores fall below thresholds, which operationalizes evaluation rather than leaving it a manual step.

Trap Treating evaluation as a one-off local check instead of a scheduled or CI/CD-gated automated workflow.

6 questions test this
The Evaluation SDK replaces prompt flow evaluation for new work

The Azure AI Evaluation SDK is the successor to the retired Evaluate-with-prompt-flow workflow; new automated evaluation should be built on azure-ai-evaluation plus Foundry evaluations, not on prompt flow, whose feature development ended on 2026-04-20 and support ends 2027-04-20.

Trap Selecting prompt flow to author or run evaluation workflows; it is on the retirement path and the Azure AI Evaluation SDK is its replacement.

4 questions test this
Agent evaluators score intent resolution, tool-call accuracy, and task adherence

Agentic evaluators judge agent behavior beyond final text: IntentResolutionEvaluator checks whether the agent correctly understood the user's intent, ToolCallAccuracyEvaluator checks whether the right tools were called with correct parameters, and TaskAdherenceEvaluator checks whether the agent followed its instructions and stayed on task.

Trap Evaluating an agent with only groundedness/relevance; agent quality also depends on intent resolution, tool-call accuracy, and task adherence.

20 questions test this
Agent evaluators consume the tool-call trace, not just the response

Agent evaluators read the agent message schema, including tool_calls, so evaluating an agent means capturing its tool-invocation trace as input, not only the final assistant message. This is why agent evaluation is tightly coupled to tracing.

Trap Feeding only query/response to an agent evaluator; without the tool_calls it cannot assess tool-call accuracy.

10 questions test this

Observability for Generative AI Applications

Read full chapter
  • Foundry observability = evaluation + monitoring + tracing
  • Continuous evaluation samples live traffic; scheduled evaluation detects drift
  • Azure Monitor alerts fire on quality-threshold or harmful-content breaches
  • Monitoring tracks latency, throughput, and error rate in real time
  • Metrics are queryable in Application Insights / Log Analytics
  • Token usage is captured as gen_ai.usage input/output tokens
  • Cost signal differs for Standard versus Provisioned deployments
  • Prompt caching discounts repeated prompt prefixes to cut token cost
  • Tracing is OpenTelemetry-based and needs an associated Application Insights
  • Instrument with configure_azure_monitor and an OpenTelemetry instrumentor
  • Tracing supports major agent frameworks
  • Prompt/response content is captured only when you opt in
  • Add custom spans and attributes; export to console for CI/CD
  • Tracing connects to the evaluation loop for root-cause debugging

Unlock with Premium — includes all practice exams and the complete study guide.

Optimize generative AI systems and model performance

Optimize RAG Performance and Accuracy

Read full chapter

Cheat sheet

Sharp facts the exam loves — scan these before test day.

Text Split skill chunks documents before embedding in integrated vectorization

In Azure AI Search integrated vectorization, a skillset runs the Text Split skill to break documents into chunks and then an embedding skill (for example the Azure OpenAI Embedding skill) vectorizes each chunk. textSplitMode is set to "pages" (default fixed-size chunks) or "sentences", and maximumPageLength plus pageOverlapLength control chunk size and overlap. Chunking is required because embedding models cap input length (text-embedding-3 models accept at most 8,191 tokens per call).

Trap Trying to embed whole documents directly: inputs over the model's 8,191-token limit are rejected, so documents must be chunked first.

7 questions test this
Chunk size and overlap trade retrieval precision against context

Smaller chunks return more precise matches but can lose surrounding context, while larger chunks preserve context but dilute relevance and cost more to embed. Microsoft recommends starting near a 512-token chunk size with about 25 percent overlap (roughly 128 tokens); pageOverlapLength repeats text at chunk boundaries so a relevant passage is not split across two chunks.

Trap Setting overlap to 0 to avoid duplicate text: zero overlap can cut a relevant passage in half across two chunks and lower recall.

7 questions test this
HNSW gives fast approximate search; exhaustive KNN gives exact but slow search

A vector field's algorithm sets the retrieval strategy: HNSW performs fast approximate nearest-neighbor search (tunable with m, efConstruction, and efSearch) and scales to large indexes, while exhaustive KNN scans every vector for exact nearest neighbors, which is more accurate but slower and costlier. An HNSW field can be forced to run exact search on a per-query basis with "exhaustive": true.

Trap Choosing exhaustive KNN for a large production index because it is 'exact': it does not scale; HNSW approximate search is the default for large indexes.

6 questions test this
The k parameter sets how many nearest neighbors a vector query returns

A vector query's k (k-nearest-neighbors) controls how many documents the retrieval step returns; increasing k raises recall by giving the reranker or LLM more candidates, at the cost of latency and noise. For hybrid queries that feed semantic ranking, Microsoft recommends setting k to 50 so the reranker receives a full candidate set.

Trap Confusing k with the embedding dimension count: k is the number of returned neighbors, unrelated to the 1,536/3,072 vector dimensions.

10 questions test this
Cosine is the correct similarity metric for Azure OpenAI embeddings

The vector field's similarity metric must match how the embedding model was trained: cosine is the default and correct choice for Azure OpenAI text-embedding models, with dotProduct and euclidean as the alternatives. On pure single-vector queries, a per-query similarity threshold (preview) can additionally drop low-scoring matches so weakly related chunks never reach the generator; hybrid/RRF queries are not eligible because their fused score ranges are too small and volatile for a cutoff.

Trap Switching the metric to euclidean to 'improve' OpenAI embedding relevance: OpenAI embeddings are tuned for cosine, so a mismatched metric degrades results.

7 questions test this
A vector-query similarity threshold drops weak matches that k would still return

A pure vector query always returns its k nearest neighbors even when they are barely similar, because the nearest-neighbor search just finds the closest vectors regardless of score. To drop weak, off-topic matches, set a per-query threshold (kind vectorSimilarity, in preview) that excludes any result scoring below the minimum even if fewer than k results remain; this is a precision lever distinct from top-k and from the similarity metric. Apply it only to single-vector queries, not to hybrid/RRF queries, whose fused rank ranges are too small and volatile for a score cutoff.

Trap Expecting a smaller k or a different similarity metric to filter out irrelevant chunks; k always returns k results, so only a similarity threshold removes weak matches, and the threshold does not apply to hybrid/RRF queries.

4 questions test this
text-embedding-3-large defaults to 3072 dimensions, 3-small to 1536

text-embedding-3-large outputs 3,072-dimensional vectors by default and text-embedding-3-small outputs 1,536; both accept up to 8,191 input tokens. A larger, higher-dimensional model captures more semantic nuance to improve domain accuracy, but it increases vector storage and query cost.

Trap Believing text-embedding-ada-002 produces 3,072 dimensions: ada-002 is fixed at 1,536, and only the v3 models reach 3,072.

13 questions test this
The dimensions parameter shortens v3 embeddings via Matryoshka learning

text-embedding-3 models support a dimensions parameter that truncates the output vector (for example from 3,072 down to 1,536 or 256) using Matryoshka Representation Learning, trading a small accuracy loss for lower storage and faster search. The same dimensions value must be used at indexing time and query time or the vectors are not comparable.

Trap Reducing dimensions only on the query side: index and query embeddings must share the same dimension count or the similarity comparison breaks.

11 questions test this
Azure OpenAI embedding models are chosen and dimension-tuned, not fine-tuned

Azure OpenAI text-embedding-3 models cannot be fine-tuned; fine-tuning applies to chat/completion models only. To raise domain-specific retrieval accuracy you select the right embedding model and dimension count, improve chunking, or add hybrid and semantic ranking, rather than training the embedding model itself.

Trap Fine-tuning text-embedding-3-large on domain data: Azure OpenAI offers no embedding-model fine-tuning; model and dimension selection plus retrieval tuning are the levers.

6 questions test this
Hybrid search fuses vector and keyword results with Reciprocal Rank Fusion

Hybrid search runs a vector (HNSW) query and a BM25 keyword query in parallel over one index and merges them with Reciprocal Rank Fusion (RRF), which combines results by rank position rather than by raw score because BM25 and cosine scores are on incompatible scales. Hybrid retrieval usually beats either method alone, especially for queries that mix exact keywords with semantic intent.

Trap Thinking RRF averages the BM25 and cosine scores: it fuses by rank position, and the raw scores are never added or averaged.

15 questions test this
Semantic ranker L2-reranks the top 50 results and scores them 0 to 4

Setting queryType=semantic adds an L2 reranking pass that rescores the top 50 RRF/BM25 results with Microsoft's language models and returns @search.rerankerScore from 4.0 (highly relevant) down to 0.0 (irrelevant). It reranks only the existing top 50 candidates and never re-queries the whole corpus, so first-stage recall still depends on the vector/keyword query.

Trap Expecting semantic ranker to surface documents the first-stage query missed: it only reorders the top 50 already retrieved, so raise recall in the retrieval query, not the reranker.

11 questions test this
Semantic ranker also returns captions, answers, and query rewrites

Beyond L2 reranking, semantic ranker returns verbatim semantic captions (usually under 200 words) and optional semantic answers extracted from indexed text, and with query rewrite enabled it expands a query into up to 10 semantically similar variants that each run and are rescored. Captions and answers are always verbatim from the index; no generative model composes new text.

Trap Assuming semantic answers are generated by an LLM: they are extracted verbatim from your index, not synthesized.

RAG evaluators score Retrieval, Groundedness, and Relevance from 1 to 5

The Azure AI Evaluation SDK and Foundry evaluations provide built-in RAG evaluators that each return a 1-to-5 score: Retrieval rates how well the retrieved chunks rank the relevant context, Groundedness rates whether the response is supported by that context without fabrication, and Relevance rates whether the response addresses the user's query. Combine them, often with content-safety evaluators, for a full quality picture.

Trap Treating Groundedness and Relevance as the same metric: Groundedness checks support by the retrieved context (hallucination), while Relevance checks that the answer addresses the question.

8 questions test this
A/B test RAG configurations on one fixed evaluation dataset

To improve a RAG system, run A/B tests that change one variable at a time (chunk size, overlap, k, embedding model or dimensions, hybrid on/off, semantic ranker on/off) and score each variant on the same evaluation dataset, then keep the configuration with the higher aggregate evaluator scores. A consistent, controlled test set, synthetic if production data is unavailable, is what makes the comparison valid.

Trap Comparing two configurations on different query sets: only a shared, fixed evaluation dataset yields a valid A/B comparison.

8 questions test this
Evaluator scores localize a RAG fault to retrieval or generation

The evaluators show where to fix a RAG system: a low Retrieval score points to indexing (chunking, embedding model or dimensions, k, or hybrid search), while a high Retrieval score with low Groundedness or Relevance points to the generation step (prompt or model), because the right context was retrieved but the answer did not use it. Fix retrieval first when Retrieval is the weak metric.

Trap Rewriting the prompt when Retrieval is low: if the right chunks were never retrieved, no prompt change can ground the answer, so fix retrieval first.

6 questions test this

Advanced Fine-Tuning and Model Customization

Read full chapter
  • Foundry offers supervised (SFT), preference (DPO), and reinforcement (RFT) fine-tuning
  • Fine-tune for behavior and format; use RAG for changing factual knowledge
  • Reinforcement fine-tuning uses graders and targets reasoning models
  • SFT training data is JSONL in the Chat Completions conversational format
  • Fine-tune files must be UTF-8 with BOM, under 512 MB, with at least 10 examples
  • DPO training files use input, preferred_output, and non_preferred_output
  • The Simulator class generates synthetic interaction data without production traffic
  • Distillation uses a large teacher model to generate data for a smaller model
  • Key fine-tuning hyperparameters are epochs, batch size, and learning-rate multiplier
  • Track training loss and token accuracy; diverging validation loss signals overfitting
  • Use a held-out validation set and post-training evaluation to confirm gains
  • A Standard fine-tuned deployment adds a per-hour hosting fee on top of token cost
  • Developer tier has no hourly hosting fee but no SLA and auto-deletes in 24 hours
  • Manage a fine-tuned model from candidate evaluation to production promotion

Unlock with Premium — includes all practice exams and the complete study guide.