Home › Studies › AI-103 › Generative AI & Agents › Generative Apps & RAG

Generative Apps & RAG

Models & deployment types · RAG and Azure AI Search · function calling & multistep flows · evaluators · Foundry SDK, connections & project endpoint

By the tools4free.dev team · Last reviewed November 13, 2026

Practice questions for this topic →

Pick a model type and a deployment type

The Foundry catalog ranges from foundation models, reasoning models, small language models and multimodal models to domain-specific and industry models. Models sold by Azure come with Microsoft support; partner and community models are supported by their providers.

NeedWhat the pages say
Small language model (edge or on-device)Meta models include small language models (SLMs) like 1B and 3B Base and Instruct models for on-device and edge inferencing
Code modelThe Codex variants (for example gpt-5.3-codex) are optimized for Codex CLI and the Codex VS Code extension
Multimodal (text and images)GPT-4o integrates text and images in a single model; vision-enabled chat models answer questions about images through the Chat Completion API on a deployed model
Image from Azure Blob Storage by SAS URLEnable Managed Identity and assign the Storage Blob Reader role to your Azure OpenAI resource
Deployment typeWhere data is processedPick it when
Global Standard (GlobalStandard)Any Azure regionDefault start for most workloads: newest models, lowest price, broadest regions
Data Zone Standard / ProvisionedWithin the data zone (US, EU or APAC)Processing must stay in a data zone
Standard / Regional ProvisionedWithin the Azure geographyGeography compliance
Provisioned typesGlobal, data zone or geographyConsistent high volume; guaranteed throughput and lower latency variance
Global Batch / Data Zone BatchAny region / within the data zoneLarge jobs that aren't time-sensitive; 50% cost savings
Developer (DeveloperTier)Any Azure regionFine-tuned model evaluation only; no SLA

Retrieval-augmented generation (RAG)

RAG combines search with an LLM so responses are grounded in your data. Use it for private or frequently changing data.

  1. Retrieve: the app queries an index or data store for relevant content.
  2. Augment: the app combines the user's question and the retrieved grounding data into a prompt.
  3. Generate: the model answers from the augmented prompt, which reduces inaccuracies and enables citations.
You needUse
Answers grounded in private or frequently changing dataRAG
To change model behavior, style or task performance, not add fresh knowledgeFine-tuning
An agent that gets retrieval as a toolAgent tools (for example the file search tool)
A full RAG app with complete controlThe Foundry SDK

A typical Foundry RAG implementation: prepare and chunk your data, set up an index, connect the project to the index, build the app with the Foundry SDK or REST APIs, then test and evaluate.

Retrieval optionHow it works
Keyword, semantic, vector or hybrid indexThe index is the data structure optimized for retrieval; Azure AI Search is a recommended index store for RAG
Hybrid searchOne request with both search and vectorQueries; full-text and vector queries run in parallel and Reciprocal Rank Fusion (RRF) merges the results
Agentic retrievalA model breaks a complex input into focused subqueries, runs them in parallel and returns structured grounding data; it uses conversation history
SymptomFix from the page
Poor retrieval qualityReview data chunking, embedding model quality and the search configuration (keyword, semantic or hybrid)
Hallucination despite groundingEnable citations and use clear system messages that tell the model to stick to the retrieved content
Latency from large indexesUse indexing strategy, filtering and re-ranking to reduce the passages processed
Token budget exceededFilter, rank or summarize passages

Tool-augmented flows and multistep pipelines

Function calling

  1. Call the chat completions API with your functions and the user's input.
  2. Use the model's response to call your API or function; your application runs the function.
  3. Call the API again with the function result to get the final response.

How much orchestration

LevelUse when
Direct model callThe model can do the task in one pass; if prompt engineering solves it you don't need an agent
Single agent with toolsVaried queries in one domain with dynamic tool use; often the right default; set iteration limits to guard against infinite tool-call loops
Multiagent orchestrationA single agent can't reliably handle the task because of prompt complexity, tool overload or security requirements; adds coordination overhead, latency and failure modes

Breaking a task into smaller steps often improves results. A search call can be an affordance that mitigates fabricated answers and brings up-to-date information. Foundry workflows (UI-based, declarative sequences with branching and human-in-the-loop steps) are retiring on December 1, 2026; use Microsoft Agent Framework for new workflows.

Evaluate models and apps

An evaluation applies one or more evaluators to a dataset, generated responses, simulated conversations or production traces. Choose what to evaluate, select evaluators, run the evaluation (once, in CI/CD or recurring) and review results.

EvaluatorMeasuresNeeds
GroundednessResponse aligns with the given context without fabricating content (precision)LLM judge: deployment_name; response and context
Groundedness Pro (preview)Strict consistency with the context, using Azure AI Content Safety; True/Falsequery, response, context; no model deployment
RelevanceAccuracy, completeness and direct relevance of the response to the queryquery, response; no ground truth
Response Completeness (preview)Whether the response misses critical information (recall)ground_truth, response
RetrievalHow relevant the retrieved chunks are to the query (LLM judge)query, context; no ground truth
Document RetrievalFidelity, NDCG, XDCG, Max Relevance and Holes against ground-truth labelsretrieval_ground_truth, retrieved_documents
Ungrounded AttributesFabricated or erroneous information inferred from user interactionsRisk and safety evaluator
Indirect Attack (XPIA)Whether the response fell for an indirect jailbreak injected through retrieved contextRisk and safety evaluator

Foundry SDKs, connections and the project endpoint

UseWhen
Foundry SDKApps with agents, evaluations or Foundry-specific features; one project endpoint
Agent FrameworkHosted agents or multi-agent systems in code (C#/.NET or Python)
LangChain Azure SDKsPython agents and workflows with LangGraph, LangChain or Deep Agents
OpenAI SDKMaximum OpenAI compatibility or lowest latency, embeddings, or Models sold by Azure through Chat Completions
Anthropic SDKAnthropic Claude models deployed in Foundry
Foundry Tools SDKsSpecific AI services such as Vision, Speech and Language

CLI and PowerShell

TaskAzure CLIPowerShell
Install the Foundry SDK (Python)pip install "azure-ai-projects>=2.3.0" "openai>=3.0.0"-
Create the project client and the OpenAI-compatible client (Python)project = AIProjectClient( endpoint=project_endpoint, credential=DefaultAzureCredential(), ) openai = project.get_openai_client()-
Call a model with the Responses API (Python)response = openai.responses.create( model="gpt-5-mini", input="What is the size of France in square miles?", )-
Resolve a project connection (Python)azs_connection = project.connections.get(SEARCH_CONNECTION_NAME)-
Create a model deploymentaz cognitiveservices account deployment create -n $accountName -g $resourceGroupName --deployment-name Phi-4-mini-instruct --model-name Phi-4-mini-instruct --model-version 1 --model-format Microsoft --sku-capacity 1 --sku-name GlobalStandard-
Check a deployment is readyaz cognitiveservices account deployment show --name <resource-name> --resource-group <resource-group> --deployment-name gpt-5-mini --query properties.provisioningState --output tsv-
Get a temporary token for the Foundry REST APIaz account get-access-token --scope https://ai.azure.com/.default-

Exam Tips

Tick each tip once you can answer it without looking.

“A general workload with no data residency or throughput requirement needs a deployment type” → Global Standard. Trap: Standard is tied to an Azure geography, Provisioned reserves capacity you may not need, and Batch is for asynchronous jobs.

“Prompts and responses must be processed only within the EU, but you still want pay-per-token billing” → Data Zone Standard (Data Zone Provisioned if you also need reserved throughput). Trap: Global types may process data in any Azure region; Standard stays within one Azure geography.

“Large jobs that aren't time-sensitive, at lower cost” → Global Batch or Data Zone Batch (50% cost savings). Trap: Standard and provisioned types are for interactive traffic; Provisioned bills reserved capacity.

“Consistent high volume with low latency variance” → A provisioned deployment type. Trap: Standard types offer best-effort service; Global Standard suits variable, bursty traffic.

“Test two content filter settings on the same model” → Deploy the same model twice under different deployment names. Trap: A deployment name must differ; you don't need a different model.

“Answers from private or frequently changing data” → RAG: retrieve, augment, generate. Trap: Fine-tuning changes behavior, style or task performance; it doesn't add fresh knowledge.

“One request mixes full-text and vector queries over one index” → Hybrid search; RRF merges the two result sets. Trap: Vector search alone misses exact terms; agentic retrieval adds LLM-planned subqueries and is a different feature.

“A complex, multi-part question must be split into subqueries that run in parallel and use conversation history” → Agentic retrieval. Trap: Classic RAG uses a single query.

“The model returns a function name and arguments: who runs the function?” → Your application; it then sends the result back in a second call. Trap: The model doesn't execute functions; it only generates the call.

“Force one specific function to be called” → Set tool_choice to a named tool object. Trap: auto lets the model decide, and function_call is deprecated.

“Response must not contain content outside the grounding context (precision)” → Groundedness; Response Completeness covers recall against ground truth. Trap: Relevance judges whether the answer addresses the query, not whether it stays inside the context.

“Retrieval quality measured with human-labeled relevance (NDCG, Fidelity, Holes)” → Document Retrieval evaluator. Trap: The Retrieval evaluator uses an LLM judge and needs no ground truth, so it can't produce NDCG.

“Strict groundedness check powered by Azure AI Content Safety, no model deployment” → Groundedness Pro (preview); it returns True/False. Trap: Groundedness is an LLM-judge evaluator that needs deployment_name.

“Which SDK for apps with agents and evaluations behind one endpoint” → The Foundry SDK (project endpoint); OpenAI SDK for lowest latency or embeddings. Trap: An Azure OpenAI resource only gives /openai/v1.

“Which client calls responses.create against a Foundry project” → The OpenAI-compatible client from project.get_openai_client(). Trap: The project client is for Foundry-native operations such as connections.

“Agent search tool needs the connection to Azure AI Search” → project.connections.get(name).id as project_connection_id; one index only; managed identity if the search service is on a private network. Trap: Key-based authentication isn't supported with a private virtual network.

Sources

Checked against Microsoft Learn on November 13, 2026.

← Generative AI & Agents overviewBuilding Agents →