Prev Next

Cloud / Azure AI Foundry Interview questions

Last updated

1. What is Microsoft Foundry (formerly Azure AI Foundry)? 2. What is the relationship between Azure AI Studio, Azure AI Foundry and Microsoft Foundry? 3. What is a Foundry resource? 4. What is a Foundry project? 5. What is the Foundry model catalog? 6. What are Foundry Models sold directly by Azure? 7. What is Foundry Agent Service? 8. What are the agent types in Foundry Agent Service? 9. What is a prompt agent in Microsoft Foundry? 10. List the built-in tools available to Foundry agents? 11. What is a model deployment in Foundry? 12. What are the deployment types in Foundry Models? 13. What is Foundry IQ? 14. What are guardrails in Microsoft Foundry? 15. What is the Foundry playground used for? 16. How do you connect to a Foundry project using the Python SDK? 17. What is the azure-ai-projects SDK? 18. What are the Foundry RBAC roles? 19. What is the Foundry Control Plane? 20. What is Foundry Local? 21. What is the difference between hub-based projects and Foundry projects? 22. What is the difference between Global Standard and Data Zone Standard deployments? 23. What is the difference between Standard and Provisioned deployments? 24. What is the difference between prompt agents and hosted agents? 25. What is the difference between an Azure OpenAI resource and a Foundry resource? 26. Explain the execution flow of a Foundry agent run? 27. How does agentic retrieval work in Foundry IQ? 28. What is the difference between a Foundry IQ knowledge base and a plain Azure AI Search index? 29. How does a request flow through a Foundry guardrail? 30. What is the difference between annotate and block in guardrail controls? 31. What is the difference between direct and indirect prompt attacks in Prompt Shields? 32. Why should you use managed identity instead of API keys with Foundry? 33. How do you troubleshoot a 401 or 403 error when calling a Foundry project endpoint? 34. How do you troubleshoot HTTP 429 errors on a Foundry deployment? 35. How can you optimize cost for large offline workloads in Foundry? 36. When should you choose Provisioned throughput over Standard? 37. When should you use the Developer deployment type? 38. How do you evaluate agent quality in Microsoft Foundry? 39. How does tracing work in Microsoft Foundry? 40. How do you secure a Foundry resource with private networking? 41. How do you use function calling with a Foundry agent? 42. How does MCP integration work in Foundry Agent Service? 43. How does agent memory work in Foundry? 44. How do workflow agents orchestrate multiple agents in Foundry? 45. How does the Foundry model router work? 46. How can you fine-tune a model in Foundry? 47. Why do we use RAG instead of fine-tuning for fresh knowledge in Foundry solutions? 48. How do you migrate from a hub-based project to a Foundry project? 49. How would you design a production RAG agent on Microsoft Foundry? 50. What happens when a guardrail blocks a prompt or a completion?

1. What is Microsoft Foundry (formerly Azure AI Foundry)?

Microsoft Foundry, previously called Azure AI Foundry, is Azure's managed platform for building, deploying and operating AI applications and agents. Model access, an agent runtime, tools, evaluation and governance sit under one Azure resource provider, so RBAC, networking and policy behave the same way across all of it.

In day-to-day work you use it to:

  • pick and deploy models from a catalog
  • build agents with built-in tools and knowledge sources
  • test, evaluate and trace those agents
  • apply guardrails and monitor them in production

You reach it through the portal at ai.azure.com, the azure-ai-projects SDK, or REST.

Take quiz
Microsoft Foundry was previously branded as:
Azure Bot Service
Azure Machine Learning Classic
Azure AI Foundry
Azure Cognitive Search Studio
What is the main benefit of Foundry using one Azure resource provider?
It removes the need for an Azure subscription
It restricts you to a single model family
It replaces Microsoft Entra ID
RBAC, networking and policy are managed in one place

2. What is the relationship between Azure AI Studio, Azure AI Foundry and Microsoft Foundry?

They are successive names for the same product line, not three different services. The portal started as Azure AI Studio, was renamed Azure AI Foundry at Ignite 2024, and became Microsoft Foundry at Ignite in November 2025.

Name Where you see it
Azure AI Studio Early preview portal and older tutorials
Azure AI Foundry 2024-2025 docs, blogs, hub-based projects
Microsoft Foundry Current docs, new portal, Foundry projects

Some URL slugs, package names and screenshots still carry the older brand, so expect a mix when reading documentation.

Take quiz
The name Microsoft Foundry was introduced at:
Ignite in November 2025
Build 2023
Ignite in November 2022
Inspire 2021
Why do you still see 'Azure AI' in some docs and URLs?
They are separate products that were never merged
Some surfaces have not fully moved to the new brand
Azure AI Foundry was retired with no successor
Only Azure OpenAI keeps the old name by design

3. What is a Foundry resource?

A Foundry resource is the top-level Azure resource that holds governance settings: networking, security, model deployments and connections. Under the hood it is a Microsoft.CognitiveServices/accounts resource of kind AIServices.

Projects are created beneath it. Services such as Storage, Key Vault and Azure AI Search stay as separate Azure resources that the Foundry resource references through connections, each with its own governance boundary.

Resource-level metrics, such as token consumption, latency and error rates, roll up across every project. An existing Azure OpenAI resource can be upgraded into a Foundry resource while keeping its endpoint and keys.

Take quiz
Where are model deployments and network settings governed in Foundry?
On each individual agent
Only in Azure Monitor workspaces
On the Foundry resource
In the project's chat history
How do Storage, Key Vault and AI Search relate to the Foundry resource?
They are embedded and cannot be managed separately
They are replaced by built-in equivalents
They must be created inside each agent
They are separate Azure resources linked through connections

4. What is a Foundry project?

A Foundry project is the unit of development and isolation inside a Foundry resource. Agents, files, evaluations and connections live in a project, and data is isolated between projects, which makes it handy for separating teams or environments.

Each project has its own endpoint:

https://<resource-name>.services.ai.azure.com/api/projects/<project-name>

You can grant RBAC at the project level and, for stricter isolation or compliance, bring your own Storage, Cosmos DB and Azure AI Search instead of using Microsoft-managed ones.

A common pattern is one project per application or environment (dev, test, prod), so evaluations, files and agent versions from one never leak into another. Creating a project is lightweight compared with creating a new resource, which is why teams usually make several.

Take quiz
A Foundry project endpoint is built from:
the Foundry resource name and the project name
the subscription ID and tenant ID only
the model name and its version
the Key Vault URI
What does a Foundry project primarily provide?
A replacement for the Azure subscription
A scope for development with isolated data and access
A billing-only grouping with no isolation
A dedicated GPU cluster

5. What is the Foundry model catalog?

The model catalog is the searchable library inside Foundry where you discover, compare and deploy models. Each model has a model card showing capabilities, supported deployment types and regional availability.

It covers models sold directly by Azure (Azure OpenAI models, DeepSeek, xAI and others), partner models such as Mistral, and open or community models, including ones from Hugging Face.

Before deploying, check the card for which deployment types a model supports, because not every model offers every option, such as provisioned or batch.

Take quiz
Where do you check which deployment types a model supports?
The Azure Advisor blade
The billing invoice
The model card in the catalog
The Key Vault access policy
The Foundry model catalog includes:
Only OpenAI models
Only models trained on your own data
Only models that run on-device
Azure-direct, partner and open models

6. What are Foundry Models sold directly by Azure?

These are models that Microsoft hosts and bills for under its own product terms, so they get Azure's enterprise commitments and support. They include Azure OpenAI models and others such as DeepSeek and xAI models.

Sold directly by Azure Partner and community
Hosted and billed by Microsoft Provider terms often apply; billing may go through Marketplace
Azure support and SLAs Support model depends on the provider
Wide choice of deployment types Options vary by model

When procurement or compliance matters, this distinction is often what decides the model choice.

Take quiz
Models sold directly by Azure are:
hosted and billed by Microsoft
billed only by the model author
available only on-premises
limited to fine-tuned models
Why does this distinction matter in enterprise projects?
It changes the Python SDK package name
It affects billing terms, support and compliance review
It decides whether a model can use tokens
It controls the portal color theme

7. What is Foundry Agent Service?

Foundry Agent Service is a fully managed platform for building, deploying and scaling AI agents. It provides the runtime that hosts agents, the tools they can call, and connections to models from the Foundry catalog, so you don't operate that infrastructure yourself.

It covers the whole loop: create an agent, test it in the playground, deploy and publish it, then monitor and evaluate it. Private networking is available for prompt and workflow agents.

The agent runtime hosts both prompt agents and hosted agents, and built-in tools include web search, file search, code interpreter, memory and MCP servers.

Take quiz
Foundry Agent Service is best described as:
a relational database engine
a CI server for container images only
a managed runtime for building, deploying and scaling agents
a DNS routing service
Which of these is a built-in tool in Agent Service?
Azure DevOps boards
Windows Defender
Power BI Embedded
Code interpreter

8. What are the agent types in Foundry Agent Service?

There are three: prompt agents, workflow agents and hosted agents. They differ in how much you define through configuration versus code.

Type Defined by Good for
Prompt agent Instructions, model, tools Fastest path, no code
Workflow agent Declarative workflow of steps/agents Multi-agent orchestration
Hosted agent Your code in a container Full control, any framework

At the time of writing, workflow and hosted agents were in preview, so confirm their status in the current docs before committing to them.

Take quiz
Which agent type runs your own containerized code?
Hosted agent
Prompt agent
Workflow agent
Playground agent
A prompt agent is defined entirely through:
a Dockerfile and a Helm chart
configuration such as instructions, model and tools
a Bicep deployment of a VM
a SQL stored procedure

9. What is a prompt agent in Microsoft Foundry?

A prompt agent is a declaratively defined single agent: you give it a model, instructions and tools, and Foundry runs it for you. There is no code to host. You can edit, version, test, evaluate and publish it from the Agents playground or through the SDK and REST.

Each save creates a new version, so you can compare or roll back. Here is a minimal sketch with the Python SDK:

from azure.ai.projects import AIProjectClient
from azure.ai.projects.models import PromptAgentDefinition
from azure.identity import DefaultAzureCredential

project = AIProjectClient(endpoint=ENDPOINT, credential=DefaultAzureCredential())
agent = project.agents.create_version(
    agent_name="billing-helper",
    definition=PromptAgentDefinition(
        model="gpt-4o",
        instructions="Answer billing questions in two sentences.",
    ),
)

The SDK surface changes between releases, so check the version you installed.

Take quiz
What does each save of a prompt agent produce?
A new Foundry resource
A new Azure subscription
A new version of the agent
A new virtual network
What do you need to host a prompt agent?
A Kubernetes cluster you manage
A custom container registry
An on-premises gateway
Nothing, Foundry runs it

10. List the built-in tools available to Foundry agents?

Agent Service ships several tools you attach by configuration:

  • Web search for current public information (preview at the time of writing)
  • File search to retrieve from uploaded documents
  • Code interpreter to run Python for calculations and data work
  • Memory to keep information across sessions (preview)
  • MCP servers to reach external tools over Model Context Protocol
  • Azure AI Search and Foundry IQ knowledge bases for grounding

For anything else, add custom tools through function calling or an OpenAPI spec.

Attach only what the agent really needs. Every extra tool adds schema text to each model call, which costs tokens and gives the model more ways to choose badly. Preview tools can change, so check their status before relying on them in production.

Take quiz
Which tool lets an agent run Python for calculations?
Code interpreter
File search
Web search
Memory
How do you give an agent a custom capability not built in?
Rebuild the model weights
Add a function, OpenAPI or MCP tool
Disable guardrails
Create a new Azure region

11. What is a model deployment in Foundry?

A deployment is a named, callable instance of a model inside a Foundry resource. It carries its own deployment type, capacity (such as tokens-per-minute quota), model version and assigned guardrail.

Your code calls the deployment name, not the underlying model name, so you can swap the model behind it without changing the application.

openai = project.get_openai_client()
resp = openai.responses.create(
    model="gpt4o-prod",   # deployment name
    input="Summarize this ticket in one line.",
)
print(resp.output_text)

Because capacity and guardrails belong to the deployment, two deployments of the same model can differ in cost and safety behavior. A common habit is one deployment per environment, such as gpt4o-dev and gpt4o-prod, with different quotas.

Take quiz
In a Foundry API call, the model parameter normally holds:
the Azure region
the subscription ID
the deployment name
the project's RBAC role
Which of these is configured per deployment?
The Azure tenant domain
The portal language
The resource group location of the user
Deployment type and capacity

12. What are the deployment types in Foundry Models?

The deployment type decides where requests are processed, how you pay and how throughput is guaranteed.

Type Processing Billing
Global Standard Any Azure region Per token
Data Zone Standard Within a data zone Per token
Standard (regional) Chosen Azure geography Per token
Provisioned (Global / Data Zone / regional) As named Reserved PTUs
Global / Data Zone Batch Asynchronous jobs Discounted per token
Developer Any region Per token, fine-tune evaluation only

Microsoft suggests Global Standard as the starting point unless residency or latency rules say otherwise.

Take quiz
Which type reserves capacity using PTUs?
Provisioned
Global Standard
Developer
Data Zone Batch
Which deployment type is meant only for fine-tuned model evaluation?
Global Standard
Developer
Provisioned
Standard (regional)

13. What is Foundry IQ?

Foundry IQ is a managed knowledge layer for agents, built on top of Azure AI Search. Instead of wiring your own RAG pipeline for every agent, you create a knowledge base once and let agents query it.

A knowledge base is made of knowledge sources (connections to places like Blob Storage, SharePoint, OneLake, search indexes or the web) plus settings that control retrieval. When queried, it uses agentic retrieval to plan searches, respect user permissions and return grounded answers with citations.

Agents can use it through Agent Service, Microsoft Agent Framework, or an MCP endpoint.

Take quiz
Foundry IQ is built on top of:
Azure Service Bus
Azure Front Door
Azure AI Search
Azure Batch
A knowledge base in Foundry IQ is composed of:
a single vector index only
a fine-tuned model checkpoint
a Kubernetes namespace
knowledge sources plus retrieval settings

14. What are guardrails in Microsoft Foundry?

A guardrail is a named collection of controls that screens prompts and responses for risk. It is the current name for what used to be called a content filter.

Typical controls cover:

  • harm categories (hate, sexual, violence, self-harm) graded safe, low, medium or high
  • Prompt Shields for direct and indirect prompt attacks
  • protected material detection
  • groundedness detection
  • custom blocklists

Each control can block or just annotate, and a guardrail is assigned to model deployments and, for some controls, to agents.

Guardrails reduce risk but don't remove it, so pair them with clear instructions, least-privilege permissions and regular evaluation.

Take quiz
In current Foundry terminology, a content filter is now called a:
guardrail
gateway
landing zone
manifest
Which control targets jailbreak and injection attempts?
Blocklists for profanity only
Prompt Shields
Provisioned throughput
Global Batch

15. What is the Foundry playground used for?

The playground is the interactive space in the Foundry portal for trying things before you write code. After you deploy a model you land in the model playground to chat with it, change parameters like temperature, and view the equivalent code.

The Agents playground does the same for agents: edit instructions, attach tools or knowledge, run test conversations, inspect tool calls, and save a new version.

It's for fast iteration and demos, not load testing, so use evaluations and tracing for anything you plan to ship.

Take quiz
What do you see right after deploying a model in the portal?
The Azure invoice page
A Terraform plan
The playground to test it
The Entra app registration page
The playground is best suited for:
load testing at production scale
storing production secrets
replacing evaluations
quick interactive testing and iteration

16. How do you connect to a Foundry project using the Python SDK?

Install the SDK, take the project endpoint from the portal, and sign in with Entra ID rather than a key.

  1. pip install azure-ai-projects azure-identity
  2. Copy the project endpoint from the project overview page.
  3. Make sure your identity has the Foundry User role (formerly Azure AI User) on the resource.
  4. Create an AIProjectClient with DefaultAzureCredential.
from azure.ai.projects import AIProjectClient
from azure.identity import DefaultAzureCredential

project = AIProjectClient(
    endpoint="https://<resource>.services.ai.azure.com/api/projects/<project>",
    credential=DefaultAzureCredential(),
)

If the call fails, check the endpoint and role first. Most connection problems are a wrong project URL, a missing Foundry User assignment, or a sign-in under the wrong tenant. In CI or on Azure, use a managed identity or service principal rather than your personal login.

Take quiz
Which credential class is typically used for keyless sign-in?
DefaultAzureCredential
PasswordVault
SasTokenBuilder
ConnectionStringSigner
Which role lets you use model deployments and create agents?
Billing Reader
Foundry User
Network Contributor
Key Vault Administrator

17. What is the azure-ai-projects SDK?

azure-ai-projects is the main Python SDK for Foundry, built around AIProjectClient. One client gives you access to agents, connections, evaluations and deployments in a project, and can hand you an OpenAI-compatible client for inference.

The 2.x line is the one recommended for new work. It follows the Responses-style model of conversations, items and responses, which differs from the older thread-and-run style used by earlier agent APIs.

That change matters when you read older tutorials: code written for 1.x or for the classic Assistants-style agents often needs porting. Equivalent SDKs exist for .NET, JavaScript and Java.

Take quiz
Which client is the main entry point of azure-ai-projects?
FoundryBlobClient
ModelRouterClient
AIProjectClient
ThreadRunner
What should you watch for when following older agent tutorials?
They always work unchanged on 2.x
They require Foundry Local
They only run inside the playground
They may use the older thread/run model and need porting

18. What are the Foundry RBAC roles?

Foundry uses Azure RBAC with roles that were recently renamed: Foundry User, Foundry Owner, Foundry Account Owner and Foundry Project Manager. They used to be Azure AI User, Azure AI Owner, Azure AI Account Owner and Azure AI Project Manager.

Role Rough purpose
Foundry User Use deployments and build agents
Foundry Project Manager Manage projects
Foundry Account Owner Manage the Foundry resource
Foundry Owner Broad ownership including access control

Give app identities the lowest role that works, normally Foundry User, and confirm exact permissions in the current role definitions.

Take quiz
Foundry User was previously named:
Azure AI User
Cognitive Reader
ML Data Scientist
Search Index Contributor
Which role is the usual least-privilege choice for an app calling models?
Foundry Owner
Foundry User
Subscription Owner
Foundry Account Owner

19. What is the Foundry Control Plane?

The Foundry Control Plane is the operations layer for AI fleets. It gives you observability, guardrails, policy controls and security in one place, and it works for agents built outside Foundry as well as inside it.

Its main pieces:

  • continuous evaluation with agent-specific evaluators such as task adherence and tool-call accuracy
  • end-to-end tracing based on OpenTelemetry
  • runtime guardrails, including protection from direct and indirect prompt attacks
  • a view of agents, models and tools in the Operate area of the portal

Pricing is tied to usage of observability, guardrails and the Microsoft security services involved.

Take quiz
The Foundry Control Plane is mainly for:
compiling model weights
managing DNS zones
operating and governing AI agents and models at scale
designing slide decks
Which tracing standard does it build on?
SNMP
Syslog RFC 3164
NetFlow
OpenTelemetry

20. What is Foundry Local?

Foundry Local runs AI models on the user's own device instead of in Azure. It exposes a local, OpenAI-compatible endpoint, so code you wrote against a cloud deployment can often be pointed at it with little change.

People use it for offline scenarios, privacy-sensitive data that must not leave the machine, and cheap prototyping without spending tokens. Quality is bounded by the model size your hardware can handle.

It can also be part of a hybrid design: a local agent can still query a cloud Foundry IQ knowledge base when needed.

Take quiz
Foundry Local runs models:
on the user's own device
only inside Azure data centers
only on Azure Batch
only inside a Logic App
What is a typical reason to choose Foundry Local?
You need a provisioned throughput SLA
Data must stay on the machine or the app must work offline
You want Global Batch discounts
You need a 100-agent workflow fleet

21. What is the difference between hub-based projects and Foundry projects?

Hub-based projects are the older architecture, built on an Azure AI hub that owned shared resources and connections. Foundry projects are the newer model, created directly under a Foundry resource, and are the recommended choice today.

Hub-based project Foundry project
Hub plus connected resources Project under a Foundry resource
Broader classic ML tooling, limited agent features Full Agent Service features
Visible in the classic portal Visible in the new portal

The practical rule: new agent features land on Foundry projects only, so plan a migration if you are still on hubs and need them.

If you still depend on classic ML features such as training jobs, check what the newer model supports before moving. For agent-focused work there is little reason to stay on hubs.

Take quiz
New agent features are primarily delivered to:
hub-based projects
Azure Logic Apps
Foundry projects
Azure Stack HCI
A Foundry project is created directly under:
an Azure AI hub
a Cosmos DB account
a Key Vault
a Foundry resource

22. What is the difference between Global Standard and Data Zone Standard deployments?

Both are pay-per-token. The difference is where your prompts and completions may be processed.

Global Standard Data Zone Standard
Processed in any region where the model is deployed Processed only inside a Microsoft-defined zone such as US or EU
Highest capability and quota Higher default quota than regional types, with zone residency
Pick when residency is not restricted Pick when data must stay in the US or EU

Note that for both, an outage in the primary region affects the traffic initially routed there, so don't treat either as a multi-region failover plan on its own.

Many teams start with Global Standard in development and move production to Data Zone Standard once legal confirms the residency rules. The code change is just the deployment name.

Take quiz
Which type keeps processing inside a US or EU boundary?
Data Zone Standard
Global Standard
Global Batch
Developer
Both Global Standard and Data Zone Standard are billed:
per reserved PTU
per token
per GPU hour
per agent version

23. What is the difference between Standard and Provisioned deployments?

Standard is pay-as-you-go: you pay per token and share capacity, limited by a quota. Provisioned reserves processing capacity measured in PTUs (provisioned throughput units), which you pay for whether or not you use it.

Standard Provisioned
Per-token billing Reserved PTUs, fixed cost
Latency can vary under load Lower latency variance
Quota exceeded gives HTTP 429 Capacity is yours up to the PTU limit
Best for spiky or low volume Best for steady, high volume

Quota is the other difference worth remembering. Standard quota is set per deployment and region, while PTUs must be sized against your expected tokens-per-minute. Sizing too low still gives 429s and too high wastes budget, so load-test with realistic prompts first.

Take quiz
Provisioned deployments are measured in:
vCPUs
DTUs
PTUs
IOPS
Which workload fits Standard best?
Steady 24/7 high volume needing tight latency
A fixed-capacity SLA contract
Reserved-capacity-only compliance rules
Spiky or low-volume traffic

24. What is the difference between prompt agents and hosted agents?

A prompt agent is configuration: instructions, a model and tools. Foundry runs it. A hosted agent is your code, packaged as a container and run by Agent Service, built with Agent Framework, LangGraph, the OpenAI Agents SDK or your own code.

Prompt agent Hosted agent
No code to host Container you build
Edited in the agent UI Not edited in the UI
Fastest path Most control

Hosted agents can still be invoked, evaluated, monitored and published. Start with a prompt agent and move to hosted only when you need custom orchestration or a specific framework.

A quick test: if you can describe the agent as a paragraph of instructions plus a few tools, it is a prompt agent. If you find yourself writing loops, custom state handling or pulling in another framework, it belongs in a hosted agent.

Take quiz
Which agent type is edited in the Foundry agent-building UI?
Prompt agent
Hosted agent
Neither
Only Foundry Local agents
When would you move from a prompt agent to a hosted agent?
When you want fewer tools
When you need custom orchestration code or a specific framework
When you want to avoid versioning
When the model is too small

25. What is the difference between an Azure OpenAI resource and a Foundry resource?

An Azure OpenAI resource gives access to OpenAI models only. A Foundry resource covers those models plus other catalog models, Agent Service, evaluation and the Foundry tools, under one governance boundary.

You do not have to start over to move: an existing Azure OpenAI resource can be upgraded to a Foundry resource while keeping its endpoint, API keys and state, and Azure Policy scoped at that level carries forward.

If your workload only needs completions from OpenAI models and no agents or evaluation, a standalone Azure OpenAI resource may still be enough. Choose Foundry when you want one resource for models, agents and governance.

Take quiz
What is preserved when upgrading Azure OpenAI to a Foundry resource?
Nothing, you must rebuild
Only the billing account
The endpoint, API keys and existing state
Only the resource group name
When might a standalone Azure OpenAI resource be enough?
When you need hosted agents
When you need Foundry IQ
When you need the Control Plane
When you only need OpenAI completions with no agents or evaluation

26. Explain the execution flow of a Foundry agent run?

A run starts when your app sends input to the agent, usually inside a conversation that holds the history. The agent sends the instructions, history and tool definitions to the model deployment. If the model asks for a tool, Agent Service runs it (or hands a function call back to your code), feeds the result to the model, and repeats until the model produces a final answer.

sequenceDiagram
    participant App
    participant Agent as Agent Service
    participant Model as Model deployment
    participant Tool
    App->>Agent: Input + conversation id
    Agent->>Model: Instructions, history, tool schemas
    Model-->>Agent: Tool call request
    Agent->>Tool: Execute tool
    Tool-->>Agent: Tool output
    Agent->>Model: Output added to context
    Model-->>Agent: Final answer
    Agent-->>App: Response
  1. Guardrails screen the input and the output.
  2. Function tools pause the run: your code runs the function and returns its output.
  3. Traces record each model and tool step for later review.

Two points are easy to miss. The conversation object keeps state on the service side, so you don't resend history yourself. And one run can loop through several tool calls before finishing, so set sensible limits and timeouts on your tools.

Take quiz
Who executes a custom function tool call?
Your own application code
The Azure portal
The Entra ID tenant
The model itself
What happens after a tool returns its output?
The conversation is deleted
It is added to the context and the model continues
The agent is redeployed
The guardrail is disabled

27. How does agentic retrieval work in Foundry IQ?

Plain RAG runs one query and hopes. Agentic retrieval uses an LLM to plan the search first. It looks at the question and chat history, breaks it into focused subqueries, picks the right knowledge sources, runs the searches in parallel, reranks and merges results, and can iterate if the evidence looks thin.

flowchart LR
    A["User question + chat history"] --> B["LLM query planning"]
    B --> C1["Subquery 1"]
    B --> C2["Subquery 2"]
    C1 --> D["Knowledge sources"]
    C2 --> D
    D --> E["Semantic rerank and merge"]
    E --> F{Enough evidence?}
    F -- No --> B
    F -- Yes --> G["Grounded answer with citations"]

A configurable retrieval reasoning effort trades latency and cost for depth. Results respect the caller's permissions where the source supports it.

Compared with a single vector query, this helps on multi-part questions, such as comparing two policies held in different systems, because each part gets its own subquery. The cost is extra LLM calls for planning and merging, so use a lower reasoning effort for simple lookups.

Take quiz
Agentic retrieval begins with:
a nightly full re-index
a fine-tuning job
an LLM planning subqueries
a manual keyword list
What does the reasoning effort setting trade off?
Region against language
Storage tier against encryption
Token size against guardrail severity
Depth of retrieval against latency and cost

28. What is the difference between a Foundry IQ knowledge base and a plain Azure AI Search index?

An index is one searchable store of content. A knowledge base sits above one or more knowledge sources, including indexes, and decides how to query them.

Azure AI Search index Foundry IQ knowledge base
Single store you query directly Multiple sources behind one endpoint
You write the query logic LLM-driven query planning and merging
You manage chunking and indexing Ingestion can be managed for supported sources
Used by any app Exposed to agents, including through an MCP tool

An existing index can be registered as a knowledge source, so adopting a knowledge base doesn't mean throwing your index away.

Whichever you choose, security trimming and the freshness of the underlying data still decide answer quality more than the retrieval wrapper does.

Take quiz
Can an existing AI Search index be used in a knowledge base?
Yes, as a knowledge source
No, it must be rebuilt
Only after deleting its vectors
Only inside Foundry Local
Which one adds LLM-driven query planning?
The raw index alone
The knowledge base
A Storage account
A virtual network

29. How does a request flow through a Foundry guardrail?

A guardrail checks twice: on the way in and on the way out. The prompt is screened against the configured controls before the model sees it. If it passes, the model generates, and the completion is screened again.

flowchart TD
    A[Prompt] --> B["Input checks: harm categories, Prompt Shields, blocklist"]
    B -->|Blocked| X["Error returned, model not called"]
    B -->|Allowed| C["Model generates"]
    C --> D["Output checks: harm categories, protected material, groundedness"]
    D -->|Blocked| Y["Completion withheld, finish reason content_filter"]
    D -->|Allowed| E["Response returned with annotations"]

Which checks run depends on what you enabled and whether each control is set to block or only annotate. Some controls apply only to certain request paths, such as agents, so test the exact path you ship.

Annotations from these checks come back with the response, so you can log severities even when nothing was blocked, which is handy for tuning thresholds. Streaming responses are checked as they are produced, so a block can appear partway through the output.

Take quiz
Are the checks applied to the model's output as well?
No, only prompts
Only when streaming is off
Yes, completions are screened too
Only in the playground
If the input check blocks a prompt:
the model still answers but is logged
the deployment is deleted
the quota is doubled
the model is not called

30. What is the difference between annotate and block in guardrail controls?

In block (filter) mode, flagged content is returned as information and also stopped. In annotate mode, the service only reports what it found and lets the content through.

Annotations can be switched on even for severity levels that you've turned off for blocking, which makes annotate useful for tuning: you watch real traffic, see what would have been flagged, and then set thresholds with evidence rather than guesses.

"content_filter_results": {
  "violence": {"filtered": false, "severity": "low"},
  "jailbreak": {"filtered": false, "detected": false}
}

A common rollout is annotate first in staging, then block in production once false positives are understood.

Whichever mode you pick, store the annotations somewhere searchable. They are your evidence when a user asks why a request was refused. Severity thresholds are also a product decision: a clinical or security tool may need different limits from a children's app.

Take quiz
In annotate mode, flagged content is:
reported but not stopped
always deleted
encrypted
routed to another region
Why use annotate mode during rollout?
To disable logging
To see what would be flagged before blocking real users
To raise the token quota
To skip the evaluation step

31. What is the difference between direct and indirect prompt attacks in Prompt Shields?

A direct attack (jailbreak) comes from the user typing instructions meant to override the system prompt. An indirect attack hides instructions inside content the model reads, such as a web page, email, document or tool result.

Direct (user prompt attack) Indirect (document attack)
Typed by the user Embedded in retrieved or tool content
Screened on the user input Screened on grounding documents
Risk grows with public chat apps Risk grows with agents that read the web, mail or files

Agents that call tools make indirect attacks more serious, because a poisoned page can trigger an action. Prompt Shields has a control for each type.

Take quiz
An instruction hidden inside a retrieved web page is a:
direct attack
quota error
indirect attack
routing rule
Why are indirect attacks especially risky for tool-using agents?
They increase PTU cost
They disable the model catalog
They change the deployment name
Poisoned content can trigger real actions

32. Why should you use managed identity instead of API keys with Foundry?

Keyless access through Microsoft Entra ID removes secrets from the picture. There is nothing to leak into source control, nothing to rotate on a schedule, and every call is tied to a specific identity you can audit and restrict with RBAC.

In Azure-hosted apps, give the app a managed identity, assign it Foundry User on the resource, and authenticate with DefaultAzureCredential. Locally the same code uses your developer sign-in.

To enforce it, disable key-based access on the resource (the disableLocalAuth property) and back it with Azure Policy so nobody quietly re-enables keys. The trade-off is a little more setup for role assignments, and some older tools may still expect a key.

Take quiz
Which property disables key-based authentication on the resource?
disableLocalAuth
enableLegacyKeys
publicKeyMode
skipEntra
What is a key advantage of managed identity?
It increases token quota
No secrets to store or rotate
It removes the need for RBAC
It makes responses faster

33. How do you troubleshoot a 401 or 403 error when calling a Foundry project endpoint?

Start by separating the two. A 401 means the service didn't accept your identity. A 403 means it knew who you were but you aren't allowed to do that.

  1. Confirm the endpoint is the project URL, not just the resource URL, and that the project name is spelled correctly.
  2. For 401, check the token: expired, issued for the wrong tenant, or requested for the wrong audience. Confirm which identity DefaultAzureCredential actually picked with az account show.
  3. For 403, list assignments with az role assignment list --assignee <id> --scope <resource-id> and look for Foundry User at the resource or project scope.
  4. Allow a few minutes after a new role assignment, because propagation is not instant.
  5. Check networking: with public access disabled, the caller must reach the private endpoint, or the firewall must allow its IP.
  6. If key auth is disabled on the resource, a request using an API key will fail by design.
Take quiz
A 403 usually points to:
a malformed JSON body
an expired DNS record
a missing permission or blocked network path
a full disk on the client
What should you check right after assigning a new role?
Delete and recreate the project
Switch to Global Batch
Raise the TPM quota
Wait for role assignment propagation, then retry

34. How do you troubleshoot HTTP 429 errors on a Foundry deployment?

A 429 means you exceeded the rate limit on that deployment, usually tokens-per-minute or requests-per-minute. First read the Retry-After header, then work out whether it's a burst or a sustained shortfall.

  1. Add retries with exponential backoff and jitter, honoring Retry-After.
  2. Check the deployment's quota in the portal and compare it with real traffic.
  3. Lower max_tokens where you can, since requested output size counts toward rate estimation.
  4. Request more quota, or spread load across several deployments or regions.
  5. Move steady heavy traffic to Provisioned, and push non-interactive work to a Batch deployment.
for attempt in range(5):
    try:
        return client.responses.create(model="gpt4o-prod", input=prompt)
    except RateLimitError as e:
        time.sleep(min(30, 2 ** attempt + random.random()))

Also separate 429 from 503 and timeouts. A 429 is a limit you control through quota and capacity, while a 503 points to service-side trouble where retries and a second region help more than extra quota.

Take quiz
Which header tells you how long to wait before retrying?
Retry-After
X-Region-Failover
Content-Encoding
ETag
Which change suits steady, heavy, latency-sensitive traffic hitting 429s?
Remove retries
Move it to a Provisioned deployment
Increase temperature
Switch to Developer

35. How can you optimize cost for large offline workloads in Foundry?

If nobody is waiting for the answer, use a Batch deployment. Global Batch and Data Zone Batch run jobs asynchronously at about 50% lower cost with a 24-hour turnaround target, and they use a separate token quota, so a big job won't starve your online traffic.

Good fits are classification of historic data, bulk summarization, embedding backfills and offline evaluation runs.

  1. Write requests as a JSONL file.
  2. Upload it and create a batch job against a batch deployment.
  3. Poll for completion and download the output file.

Pick Data Zone Batch instead of Global Batch when the data must stay in a US or EU zone. Don't use batch for chat or anything with a latency expectation.

Take quiz
Typical cost saving for Global Batch compared with standard pricing:
About 5%
None, it costs more
About 50%
100% free
Why don't batch jobs hurt your online traffic quota?
They run on your laptop
They are throttled to zero
They share the chat deployment's TPM
Batch uses a separate token quota

36. When should you choose Provisioned throughput over Standard?

Choose Provisioned when your traffic is steady, high and latency-sensitive, and when a 429 during peak hours is a business problem rather than an inconvenience.

The deciding signals are:

  • a predictable baseline that keeps the PTUs well utilized
  • a contractual or product latency target that variable shared capacity can't promise
  • a need to budget a fixed monthly cost

Stay on Standard for prototypes, spiky or seasonal use, and low volume, since idle PTUs still cost money. Azure reservations can reduce the price of long-running PTU commitments. Many teams run Provisioned for the baseline and keep Standard for overflow experiments.

Take quiz
Which scenario justifies Provisioned throughput?
Steady high-volume traffic with a strict latency target
A weekend prototype
A one-off data migration
A demo used twice a month
Why can Provisioned be wasteful for spiky workloads?
It blocks all retries
You pay for reserved PTUs even when idle
It disables guardrails
It forces a single region

37. When should you use the Developer deployment type?

Use it to evaluate a fine-tuned model cheaply, before you commit to a production deployment type. It bills per token, runs in any region, and has no hourly hosting cost.

The catch is what you give up: no SLA and no data residency guarantee. So it's the wrong place for customer traffic or regulated data.

  1. Fine-tune the model.
  2. Deploy it with the Developer type and run your evaluation set.
  3. If results hold, redeploy on Standard or Provisioned for production.

Before leaving Developer, record the metrics you saw. A fine-tuned model that looks good in evaluation can still behave differently under production sampling settings, so rerun a smaller check after redeploying.

Take quiz
The Developer deployment type is intended for:
production chat traffic
regulated data in the EU only
evaluating fine-tuned models
reserved PTU capacity
What does Developer deployment NOT provide?
Per-token billing
Access to any region
Support for fine-tuned models
An SLA or data residency guarantee

38. How do you evaluate agent quality in Microsoft Foundry?

You run evaluators against test conversations and look at the scores per agent version. Foundry offers agent-specific evaluators in addition to the usual quality ones.

Evaluator Checks
Task adherence Did the agent do what was asked?
Intent resolution Did it understand the user's goal?
Tool call accuracy Right tool, right arguments?
Groundedness Is the answer supported by sources?

Build a dataset of realistic and adversarial queries, run it from the portal or locally through the SDK, and compare versions before publishing. In production, continuous evaluation on sampled live traffic catches drift. Scores from an LLM judge are signals, so spot-check some rows by hand.

Take quiz
Which evaluator checks whether the right tool was called with proper arguments?
Tool call accuracy
Groundedness
Fluency only
Latency
Why compare evaluation scores across agent versions?
To reduce the token quota
To catch regressions before publishing
To rename the project
To disable tracing

39. How does tracing work in Microsoft Foundry?

Foundry builds on OpenTelemetry. You connect an Application Insights resource to the project, instrument your app, and each model call, tool call and agent step is recorded as a span in a trace you can open in the portal.

import os
from azure.monitor.opentelemetry import configure_azure_monitor

configure_azure_monitor(
    connection_string=os.environ["APPLICATIONINSIGHTS_CONNECTION_STRING"]
)

A trace shows the order of steps, latency per step, token counts and errors, which is what you need to debug why an agent picked the wrong tool or why a run was slow.

Prompt and response content may be sensitive, so recording of message content is typically an explicit opt-in. Decide that on purpose rather than by default.

Add your own spans around business steps, such as validating an order or reranking results, so the trace tells the whole story rather than only the model calls.

Take quiz
Foundry tracing is based on:
Windows Event Log only
SMTP
OpenTelemetry
RADIUS
Why is recording message content usually opt-in?
It breaks guardrails
It is not technically possible
It raises PTU price
Prompts and responses can contain sensitive data

40. How do you secure a Foundry resource with private networking?

The aim is that traffic to the resource and everything behind it never crosses the public internet.

  1. Create a private endpoint for the Foundry resource in your VNet and set up private DNS.
  2. Turn off public network access on the resource.
  3. Put connected services, such as Storage, Azure AI Search and Cosmos DB, behind private endpoints too.
  4. For agents, use the standard setup where you bring your own Storage, Cosmos DB and AI Search so data lands in resources you control.
  5. Combine with managed identity and RBAC, and enforce it with Azure Policy.

Private networking is available for prompt and workflow agents, while hosted agents have their own network controls, so check the current docs for the agent type you use. DNS is the usual culprit when something works from the portal but not from the VNet.

Take quiz
What is the first network building block for private access?
A private endpoint for the Foundry resource
A public IP on the project
A CDN profile
A bastion host
Where does a 'works in portal, fails in VNet' problem usually come from?
Wrong token size
Private DNS resolution
Too many agent versions
Missing GPU quota

41. How do you use function calling with a Foundry agent?

You describe your function to the model with a JSON schema. The model never runs it. It returns a function call with arguments, your code executes the real function, and you send the result back so the model can finish the answer.

tools = [{"type": "function", "name": "get_order_status",
  "description": "Look up an order by id",
  "parameters": {"type": "object",
    "properties": {"order_id": {"type": "string"}},
    "required": ["order_id"]}}]

resp = openai.responses.create(model="gpt4o-prod", input="Where is order 8812?", tools=tools)
for item in resp.output:
    if item.type == "function_call":
        result = get_order_status(**json.loads(item.arguments))
        resp = openai.responses.create(
            model="gpt4o-prod", previous_response_id=resp.id,
            input=[{"type": "function_call_output", "call_id": item.call_id,
                    "output": json.dumps(result)}])

Write precise descriptions and validate arguments before running anything with side effects.

Two details trip people up. Arguments arrive as a JSON string you must parse, and the model can occasionally produce arguments that don't match your schema, so validate them first. For longer chains, loop until the response has no more function calls, and require explicit confirmation for functions that change data.

Take quiz
Who actually runs the function in function calling?
The model
Azure Monitor
Your application code
The Entra tenant
What links your function result back to the right request?
The project name
The VNet ID
The guardrail name
The call_id of the function call

42. How does MCP integration work in Foundry Agent Service?

Model Context Protocol (MCP) gives agents a standard way to use external tools. You attach an MCP tool to the agent with the server's URL and a label, and the agent discovers the tools that server exposes.

from azure.ai.projects.models import MCPTool

tool = MCPTool(
    server_label="knowledge-base",
    server_url="https://<search>.search.windows.net/knowledgebases/<kb>/mcp",
    require_approval="always",
)

Two settings deserve care. Approval lets you require human or app approval before a tool runs, which matters for tools that change data. Authentication can go through a project connection, such as one using the project's managed identity.

A real example is Foundry IQ: a knowledge base is exposed over MCP, and agents call its retrieval tool to get grounded answers. Treat third-party servers as untrusted input, since their output can carry indirect prompt attacks.

Take quiz
What does the require_approval setting control?
Whether a tool call needs approval before it runs
The model's temperature
The deployment region
The size of the context window
Why treat third-party MCP servers as untrusted?
They always run slower
Their outputs can carry indirect prompt attacks
They disable RBAC
They cannot return JSON

43. How does agent memory work in Foundry?

Memory lets an agent remember things across sessions, such as a user's preferred language or earlier decisions, rather than only within one conversation. It is a separate store, not just a longer chat history.

Conceptually it works in three moves: facts are extracted from conversations, consolidated so duplicates and changes are merged, and retrieved when relevant to a new request. The agent then sees them as extra context.

  • Scope memory per user so people never see each other's data.
  • Decide what is allowed to be stored, and how it can be viewed or deleted.
  • Remember it is in preview at the time of writing, so verify behavior in current docs.
Take quiz
Agent memory differs from chat history because it:
replaces the model
only stores images
persists useful facts across sessions
resets after each token
What is an important design rule for memory?
Share one memory across all users
Store every raw message forever
Disable deletion
Scope it per user and control what is stored

44. How do workflow agents orchestrate multiple agents in Foundry?

A workflow agent is a declarative flow that coordinates a sequence of actions or several agents. Instead of one agent juggling everything, each step has one job, and the workflow decides who runs next.

Documented patterns include sequential (agent A feeds agent B), group chat (several agents discuss and converge) and human-in-the-loop (the flow pauses for a person to approve or supply input). You can design them visually in the portal or define them in code.

Use a workflow when the process is known and repeatable, such as research, then draft, then review. For open-ended tasks one well-equipped agent is often simpler. Workflow agents were in preview at the time of writing.

Take quiz
A pattern where agent A passes its output to agent B is called:
sequential
round robin DNS
blue-green
sharding
When is a workflow agent a better fit than a single agent?
When the task is totally open-ended
When the process has known, repeatable steps
When you want to avoid versioning
When no tools are needed

45. How does the Foundry model router work?

The model router is a deployable model that acts as one endpoint in front of several underlying models. For each prompt it picks a model based on factors such as complexity, cost and quality, so easy requests can go to a cheaper model while hard ones go to a stronger one.

You deploy it once and call it like any other deployment. The response tells you which underlying model answered, which helps with cost analysis and debugging.

Benefit Trade-off
Lower average cost on mixed workloads Less predictable model behavior
One deployment to manage Small routing overhead

Test it against your own evaluation set. If you need identical behavior every time, pin a specific model instead.

Take quiz
The model router chooses a model:
once per month
per Azure region only
per prompt, based on factors like complexity and cost
per user password
When should you pin a specific model instead of the router?
When you want lower cost on mixed prompts
When you want one deployment
When prompts vary in difficulty
When you need identical behavior on every call

46. How can you fine-tune a model in Foundry?

Fine-tuning adapts a supported base model with your own examples. The model must support it, so check its card first.

  1. Prepare training (and validation) data as JSONL in the chat format, with consistent, high-quality examples.
  2. Upload the files and create a fine-tuning job in the portal or via the SDK.
  3. Watch training and validation loss to spot overfitting.
  4. Deploy the result, using Developer deployment to evaluate it cheaply.
  5. Compare it with the base model on your evaluation set, then promote it to a production deployment type.

A few hundred clean examples often beat thousands of noisy ones. Fine-tune for style, format and narrow behavior, not to inject facts that change.

Take quiz
Training data for chat fine-tuning is normally supplied as:
JSONL
a PowerPoint file
a Docker image
an ARM template
What helps you detect overfitting during training?
Counting deployments
Comparing training and validation loss
Checking the portal theme
Reading the invoice

47. Why do we use RAG instead of fine-tuning for fresh knowledge in Foundry solutions?

Fine-tuning changes how a model behaves, but it is a poor way to teach it facts. Facts baked into weights go stale, can't be cited, and need another training run to update. RAG keeps knowledge outside the model and retrieves it at question time.

RAG (e.g. Foundry IQ) Fine-tuning
Update by changing the data Update by retraining
Can show citations No source attribution
Can enforce per-user permissions Weights are the same for everyone
Best for facts and documents Best for tone, format, narrow skills

They are not exclusive. Plenty of systems fine-tune for output format and use RAG for the knowledge.

Take quiz
Which approach supports citations and per-user permissions?
Fine-tuning
Neither
RAG
Pretraining from scratch
Fine-tuning is best used to adjust:
daily changing facts
access control lists
network routes
style, format and narrow behavior

48. How do you migrate from a hub-based project to a Foundry project?

Treat it as a move to a new home rather than an in-place switch, and plan it in stages.

  1. Inventory what you have: model deployments, connections, agents, files, evaluations and role assignments.
  2. Create (or upgrade to) a Foundry resource and a Foundry project, with the networking and identity you want.
  3. Redeploy models and recreate connections, preferring managed identity.
  4. Rebuild agents on Agent Service and port code to the current azure-ai-projects 2.x conversation and response model.
  5. Re-run evaluations side by side, then cut traffic over and retire the hub.

The new portal shows only Foundry projects, while the classic portal still shows hubs, so keep both in mind during the transition. Confirm any automated migration options in the current docs before relying on them.

Take quiz
Why is it wise to re-run evaluations during migration?
To confirm behavior matches before cutting over
To free up PTUs
To rename the subscription
To convert JSON to CSV
Which portal still shows hub-based projects?
The new portal only
The classic portal
Azure Monitor
Azure Advisor

49. How would you design a production RAG agent on Microsoft Foundry?

Keep each concern in its own layer and make the data path private and identity-based.

flowchart LR
    U["Client app"] --> A["Published agent application"]
    A --> G[Guardrail]
    G --> M["Model deployment"]
    A --> K["Foundry IQ knowledge base"]
    K --> S["Azure AI Search"]
    S --> D[(Blob / SharePoint / OneLake)]
    A --> T["Tracing to Application Insights"]
  1. A prompt agent holds instructions and the knowledge base tool, versioned and published.
  2. A Foundry IQ knowledge base does retrieval with citations and user permissions.
  3. Guardrails include Prompt Shields, because retrieved content is untrusted.
  4. Apps and agents use managed identity, with private endpoints for the resource and its dependencies.
  5. Evaluators run on a fixed test set before each release, with tracing and continuous evaluation afterwards.

Pick Provisioned throughput only if the baseline traffic justifies it.

Plan for the failure modes: stale index content, empty retrieval, a tool timeout and quota exhaustion. Tell the agent to say it doesn't know when retrieval returns nothing, add timeouts and retries around tools, and alert on groundedness drops rather than only on errors.

Take quiz
Why include Prompt Shields in a RAG design?
They speed up embeddings
They replace the search index
Retrieved documents are untrusted and may hold injected instructions
They remove the need for RBAC
Which component handles retrieval with citations in this design?
The Developer deployment
Foundry Local
The playground
The Foundry IQ knowledge base

50. What happens when a guardrail blocks a prompt or a completion?

The two cases look different to your code.

  • Blocked prompt: the request fails with HTTP 400 and an error code of content_filter. The model is never called. Details sit under prompt_filter_results.
  • Blocked completion: the call succeeds with HTTP 200, but the choice's finish_reason is content_filter and the content is withheld or cut short. Details sit under choices[].content_filter_results.
if choice.finish_reason == "content_filter":
    log(choice.content_filter_results)
    return "I can't help with that request."

With streaming, content can be cut off mid-response. If legitimate users are being blocked, don't just switch filters off: put a test set through annotate mode, look at which category and severity fired, then adjust that threshold or create a narrower custom guardrail.

Log the category, severity and request id for every block. When you tune a guardrail or contact support, those details help far more than a screenshot of the refusal message.

Take quiz
A completion blocked by a guardrail shows which finish_reason?
content_filter
stop
length
tool_calls
What does a blocked prompt typically return?
HTTP 200 with an empty body
HTTP 400 with a content_filter error
HTTP 301 redirect
HTTP 507
«
»

Comments & Discussions