Match the job to the smallest thing that passes your tests. A reasoning model (such as o4-mini) plans multistep problems. A small language model (such as Phi-4-mini) handles narrow, high-volume work cheaply. A multimodal model accepts images or audio as well as text. A Foundry Tool such as Content Understanding, Azure Speech or Azure Language does a fixed job with no prompt work. For the service: Foundry Models for generating, Foundry IQ on Azure AI Search for grounding and vector search, Foundry Agent Service for agent workflows. Check the model card (inputs, context window, regions, deployment types) and then your own test set.
- Smallest model that passes your tests wins. Move up only when it fails.
- Reasoning models for multistep problems, small models for narrow high-volume work, multimodal models for images and audio.
- Foundry Tools do fixed jobs (documents, speech, language, vision) with predictable output.
🎯 Exam tip: "Multistep planning or maths" = a reasoning model.
⚠️ Watch out: Sending photos to a text-only model and getting a 400 error.
Put curated company content in a Foundry IQ knowledge base on Azure AI Search, which can use keyword, vector, hybrid (best default) and semantic ranking, and agentic retrieval to plan sub-queries. Use file search for files a user uploads in a conversation. Use memory for what the agent learns about a person across sessions: user profile memory and chat summary memory, scoped per user. Plan indexing with indexers (pull) or the push API, chunking and integrated vectorization. Connect other tools with MCP, OpenAPI or functions. Knowledge answers "what's true here", memory answers "what do we know about this person".
- Knowledge bases (Foundry IQ on Azure AI Search) hold curated company content and return cited passages.
- Hybrid search with semantic ranking is the usual strong default. Pure vector misses exact terms.
- File search covers files a user uploads in a conversation, without a separate index build.
🎯 Exam tip: "Exact codes and meaning-based matches" = hybrid search.
⚠️ Watch out: Using memory to store company policy, or a knowledge base to store personal preferences.
A Foundry resource (kind AIServices) holds model deployments, networking, keys and identity. Projects inside it separate teams and apps. For agents, the basic setup uses Microsoft-managed storage, and the standard setup keeps threads, files and vectors in your own Cosmos DB, Storage and Azure AI Search, so you control retention, encryption and networking. Deployment types: Global Standard (best throughput, data may be processed anywhere), Data Zone Standard (stays in the EU or US zone), Standard (one geography), Provisioned (reserved PTUs for steady latency) and Global Batch (cheaper, results within 24 hours).
- One Foundry resource holds deployments, keys, networking and identity. Projects isolate teams and apps.
- Standard agent setup puts agent data in your own Cosmos DB, Storage and AI Search. Basic uses managed storage.
- Global = best capacity, any region. Data Zone = EU or US zone. Standard = one geography.
🎯 Exam tip: "Data must remain in the EU" = Data Zone (or regional Standard).
⚠️ Watch out: Choosing a Global deployment when a contract says data stays in the EU.
A model deployment pins a model name and version, a deployment type, capacity (tokens per minute, or PTUs), a version upgrade policy and a guardrail. Pin a version when behaviour must not change, and choose an upgrade option if you want newer defaults. An agent gets a new version every time its definition changes, so you can test one version, publish it, and roll back by pointing the endpoint at the earlier version. Apps call the project endpoint with the deployment name or the agent name, never the model name.
- A deployment pins model, version, deployment type, capacity, upgrade policy and guardrail.
- Code calls the deployment name, so the model behind it can change.
- Pin the version when behaviour must be stable, and re-test before upgrading.
🎯 Exam tip: "Behaviour must not change until we approve" = pin the version, no auto upgrade.
⚠️ Watch out: Letting auto upgrade change a regulated app's model without re-running evaluations.
Keep the agent definition, prompts, evaluation set and Bicep in Git. A pipeline (GitHub Actions or Azure DevOps) signs in with workload identity federation (an OIDC federated credential on a managed identity or app registration), so no secret is stored. It deploys the infrastructure with Bicep to a dev project, runs an evaluation on a fixed test set as a gate, and only then promotes the same definition to test and prod projects, each with its own RBAC and approvals. Prod secrets don't exist; access is by role.
- Agents, prompts, evaluation data and Bicep live in Git and flow through pull requests.
- Federated credentials let a pipeline sign in without a stored secret.
- An evaluation step is a release gate. Failing scores stop promotion.
🎯 Exam tip: "No secrets stored in the pipeline" = workload identity federation.
⚠️ Watch out: Storing a client secret in repository secrets when federation is available.
Quota is tokens per minute (TPM) for each model, deployment type and region in a subscription. Each deployment takes a slice of it, and requests per minute (RPM) come with the slice (about 6 RPM per 1,000 TPM for OpenAI models). Go past the limit and the service answers HTTP 429 with a retry-after header. Handle it with exponential backoff and retry, split load across deployments or regions, use Provisioned throughput for steady load with spillover to a standard deployment for peaks, and control spend with token budgets, cost alerts, smaller models, shorter prompts and caching.
- Quota is TPM per model, deployment type and region. Deployments take slices of it.
- RPM comes with the TPM slice. Exceeding either gives HTTP 429.
- Handle 429 with retry-after, exponential backoff and jitter.
🎯 Exam tip: "Requests fail with 429 at peak" = backoff and retry, more capacity, or spillover.
⚠️ Watch out: Retrying instantly in a tight loop, which makes throttling worse.
Use Azure Monitor metrics for requests, tokens, latency and errors, Application Insights for traces of every model and tool call, and continuous evaluation to score a sample of live answers for groundedness, relevance and safety, which is how you spot drift. Alert on content filter and guardrail events. For Azure AI Search, watch indexer run history and failed items, document counts, search latency, throttled queries and relevance (click-through, evaluation with test queries). When groundedness falls, check the index before you blame the model.
- Azure Monitor gives metrics, Application Insights gives traces, continuous evaluation gives quality scores.
- Drift shows up as falling groundedness or relevance. Check recent changes first.
- Alert on safety and guardrail events, error rates and latency.
🎯 Exam tip: "Detect quality decline in production" = continuous evaluation.
⚠️ Watch out: Blaming the model when the index was stale.
Use Microsoft Entra ID instead of keys. Give the app a managed identity and assign it the Foundry User role on the resource or project (least privilege), then disable local (key) authentication so a leaked key is useless. Close the front door with public network access: Disabled and add a private endpoint in your virtual network, backed by a private DNS zone. Use role policies (RBAC and Azure Policy) to keep it that way. In code, use DefaultAzureCredential and a token provider, not an API key.
- Use Entra ID tokens through DefaultAzureCredential. Managed identities remove stored secrets.
- Assign Foundry User at the narrowest scope that works. Owner and Contributor aren't for app access.
- disableLocalAuth true makes keys useless. Public network access Disabled closes the internet door.
🎯 Exam tip: "No secrets in code" = managed identity with DefaultAzureCredential.
⚠️ Watch out: Disabling keys before the app is switched to Entra ID.
A guardrail in Foundry is a set of controls. Each control combines a risk (hate, sexual, violence, self-harm, user prompt attacks, indirect attacks, protected material, PII), an intervention point (user input, tool call, tool response, output) and an action (annotate, or annotate and block), with a severity threshold for harm categories. Attach the guardrail to a model deployment or an agent. Prompt Shields catch jailbreaks (from the user) and indirect attacks (hidden in documents and tool results). Start strict, review what gets blocked, then tune, because a loose filter lets harm through and a tight one blocks real users.
- A guardrail is a set of controls: risk, intervention point, action.
- Intervention points are user input, tool call, tool response and output.
- Prompt Shields cover jailbreaks and indirect attacks. Indirect attacks come from content, not the user.
🎯 Exam tip: "Hidden instructions in a web page or document" = indirect attack (Prompt Shields).
⚠️ Watch out: Checking user input only and ignoring tool responses.
Use evaluators to score answers: quality (groundedness, relevance, coherence), safety (violence, hate and unfairness, self-harm, sexual, protected material) and agent evaluators (intent resolution, tool call accuracy, task adherence). Run the AI red teaming agent to attack the app before launch and report an attack success rate. Evaluator results include a reason, which gives explanations. For auditing, turn on tracing to Application Insights so every model call, tool call and approval is recorded, keep provenance metadata (source documents, model version, who approved) and use approval workflows for risky actions.
- Evaluators score quality, safety and agent behaviour, with a reason for each score.
- Tool call accuracy and task adherence are agent evaluators. Groundedness needs context.
- The AI red teaming agent attacks before launch and reports an attack success rate.
🎯 Exam tip: "Is the answer supported by the retrieved text" = groundedness.
⚠️ Watch out: Running evaluators once and never in the pipeline or on live samples.
Govern an agent with least privilege. Give it only the allowed tools it needs, set risky tools to require approval from a human (human-in-the-loop), and choose an oversight mode: fully supervised, approval for sensitive actions, or autonomous for low-risk work. Add a tool call guardrail to check what the agent sends, give the agent its own identity with narrow RBAC, and limit where a hosted agent can connect with network egress controls. Log every decision in traces. Prompts alone aren't a control, because a model can be talked out of its instructions.
- Least privilege for agents: allowed tools, narrow identity, narrow data access.
- Risky or irreversible tools require human approval. Read-only tools usually don't.
- Enforce constraints outside the prompt. Prompts guide, controls enforce.
🎯 Exam tip: "A person must confirm before the action runs" = require approval (human-in-the-loop).
⚠️ Watch out: Putting safety rules only in the system prompt.