ERW CommandPMO

AI-103 CERTIFICATION BOOTCAMP

Developing AI Apps and Agents on Azure — Build it, run it, name it exactly.

← Course home
40 sessions · 45 minutes each · 8 weeks at your own pace · One track: your own Azure subscription
WEEK 6 OF 8 · SEARCH, EXTRACTION AND VISUAL UNDERSTANDING · SESSIONS 26–30
This week’s assessments: Pop Quiz 5 — Search and Understanding after Session 30
Every session: the exact names Microsoft uses · one assignment marked against a published rubric · pass mark 70 · Certificate: capstone at 70+ and the marked Final at 700+
E · Implement information extraction solutions · 10–15%SESSION 26
Semantic, hybrid and vector search; enrichment with skills
Session 26 of 40 · 45-minute session
Skills measured — Microsoft’s wording
  • Configure semantic search, hybrid search, and vector search for grounding
  • Implement enrichment by using custom or built-in skills for text, images, and layout

Why This Matters

Grounding is only as good as the passages you hand the model. In Session 25 you built an index; today you make it answer well. AI-103 expects you to configure the three retrieval modes by their exact names: a semantic configuration for the semantic ranker, a vector profile with its algorithm, and a hybrid query that runs keyword and vector search together. It also expects you to know which enrichment skill adds text, image or layout understanding during indexing, and when you would write your own. At work, this is the difference between an assistant that quotes the right policy paragraph and one that confidently quotes the wrong one. You will run one question three ways against your own index, and add one skill.

IN YOUR SUBSCRIPTION
Creates
No new Azure resource. You change the Azure AI Search service and index you built in Session 25 (in rg-ai103): you add a semantic configuration to the index, add one skill to its skillset, and rerun the indexer. If you deleted the embedding model deployment that your index’s vectorizer calls, redeploy the same model under the same deployment name first.
Cost
Billed. On the Dedicated pricing model a search service bills hourly while it exists; only deleting it stops that. The semantic ranker’s default Free plan has a monthly allowance, after which requests return a billing error unless you choose Standard. Built-in skills are free for 20 documents per indexer per day, then need a billable Foundry resource. Vector queries call your embedding deployment, billed per token. Check the Azure AI Search pricing page and the pricing calculator.
Clean-up
Keep the search service, index, storage account and embedding deployment for Session 27. If you are pausing the course, delete the search service (Resource groups → rg-ai103 → the service → Delete), the Session 25 storage account and the embedding deployment (Build → Models).
The 45-Minute Session
7:00 – 16:00
Vector configuration: fields, profiles, algorithms and vectorizers
  • A vector field has a vector type (usually Collection(Edm.Single)), dimensions matching your embedding model, and a vectorSearchProfile naming a profile. searchable must be true; filterable, facetable and sortable must be false, so you filter on a separate field.
  • A profile (vectorSearch.profiles) is a named combination of algorithm and compression settings, optionally with a vectorizer. Every field that points to it inherits its behaviour.
  • AlgorithmkindHow it searchesChoose it when
    Hierarchical Navigable Small World (HNSW)hnswApproximate nearest neighbour (ANN) search over a graphMost indexes, especially larger ones: high recall with low latency
    Exhaustive K-Nearest Neighbors (KNN)exhaustiveKnnA brute-force scan of every vectorSmall to medium data where precision matters more than speed, or to build a ground-truth set that measures HNSW recall
  • HNSW parameters, with defaults at the time of writing: m 4, efConstruction 400, efSearch 500. Use metric cosine for Azure OpenAI embeddings; the others are dotProduct, euclidean and hamming.
  • To test exactness without re-indexing, set exhaustive to true on a vector query: it runs exhaustive KNN even on an HNSW field.
  • A vectorizer (kinds azureOpenAI, aml, aiServicesVision, customWebApi) embeds the query at query time, so you can send text (kind text). Without one, you embed the question yourself and send numbers (kind vector).
  • pythonindex_fragment.pytype it yourself
    # For recognition only: how Learn's Python quickstart declares vector search
    SearchField(
        name="DescriptionVector",
        type=SearchFieldDataType.Collection(SearchFieldDataType.Single),
        searchable=True,
        vector_search_dimensions=1536,
        vector_search_profile_name="my-vector-profile",
    )
    vector_search = VectorSearch(
        algorithms=[HnswAlgorithmConfiguration(name="my-hnsw-vector-config-1")],
        profiles=[VectorSearchProfile(
            name="my-vector-profile",
            algorithm_configuration_name="my-hnsw-vector-config-1",
        )],
    )
  • THE EXAM LINE

    HNSW (hnsw) is approximate and suits most indexes; exhaustive KNN (exhaustiveKnn) scans every vector. Each vector field names a profile, and the profile names the algorithm, any compression and any vectorizer.

If a vector query returns nonsense, check the dimensions and the embedding model first. A mismatch there is the commonest fault I see.
24:00 – 34:00
Hands-on: one question, three ways
  • Run pip install azure-search-documents azure-identity and az login. Reuse AZURE_SEARCH_SERVICE_ENDPOINT from Session 25 (the SDK readme’s name). Set SEARCH_INDEX, my variable from Session 7, to the index the wizard created, and AZURE_SEARCH_SEMANTIC_CONFIG, also mine, to your semantic configuration’s name.
  • The script uses VectorizableTextQuery because your index has a vectorizer, and the wizard’s field names (title, chunk, text_vector); adjust them if yours differ. With semantic ranking over vectors, Learn says to set k to 50, the ranker’s maximum input.
  • pythonsearch_three_ways.pytype it yourself
    import os
    from azure.identity import DefaultAzureCredential
    from azure.search.documents import SearchClient
    from azure.search.documents.models import VectorizableTextQuery
    
    client = SearchClient(
        endpoint=os.environ["AZURE_SEARCH_SERVICE_ENDPOINT"],
        index_name=os.environ["SEARCH_INDEX"],  # course-own name
        credential=DefaultAzureCredential(),
    )
    QUESTION = "<a question your users really ask>"
    
    def text_vector(k):
        # The index's vectorizer turns the text into a vector at query time
        return VectorizableTextQuery(
            text=QUESTION, k_nearest_neighbors=k, fields="text_vector", kind="text"
        )
    
    runs = {
        "keyword": dict(search_text=QUESTION, top=5),
        "vector": dict(vector_queries=[text_vector(5)]),
        "hybrid + semantic": dict(
            search_text=QUESTION,
            vector_queries=[text_vector(50)],
            query_type="semantic",
            semantic_configuration_name=os.environ["AZURE_SEARCH_SEMANTIC_CONFIG"],
            top=5,
        ),
    }
    for label, args in runs.items():
        print(f"\n=== {label} ===")
        for r in client.search(select=["title", "chunk"], **args):
            rerank = r.get("@search.reranker_score")
            print(f"{r['@search.score']:.4f} rerank={rerank} {r['title']}: {r['chunk'][:60]}")
    WHAT YOU SHOULD SEE
    === keyword ===
    <score> rerank=None <title>: <first 60 characters of the chunk>
    ...
    === vector ===
    <score> rerank=None <title>: <...>
    ...
    === hybrid + semantic ===
    <score> rerank=<reranker score> <title>: <...>
  • Each mode scores differently (BM25, similarity, RRF), so compare the order of results, not the @search.score values. @search.reranker_score appears only when the semantic ranker ran.
  • Learn’s vector quickstart shows the effect to look for: RRF puts one hotel first, and semantic reranking lifts a better match above it.
  • One detail the exam likes: k sets the number of results for a vector-only query, top sets it for a query that includes search text, and if neither is set the response returns 50 results.
  • If the vector run fails, check that the embedding deployment the vectorizer calls still exists under the same name.
Pick a question with a product code or a date in it. That is where you will see keyword and vector disagree, and hybrid earn its keep.
41:00 – 45:00
Wrap-up: write it down, then run and compare
  • Write down: the four modes and their index sections; HNSW versus exhaustive KNN; profile and vectorizer; the parts of prioritizedFields; k versus top; a built-in skill each for text, images and layout; the Custom Web API contract.
  • Your assignment: the same question run three ways, with the results compared and explained, and one skill added to your pipeline with the indexer run to prove it.
  • Clean-up: keep the search service, index, storage account and embedding deployment for Session 27. Nothing else was created. Crop your search endpoint out of screenshots, and never paste a key: you should not need one today.
  • If the indexer run fails after your skillset edit, open its execution history, copy the exact error, and send it to me through “Ask R. Wingo” today.
Evidence beats description: three result lists side by side say more than a page about hybrid search.

The exact names

As Microsoft prints them — the exam and the marker both expect these, letter for letter.
semantic configurationfeatureThe index section that tells the semantic ranker which title, content and keyword fields to read.Learn →
prioritizedFieldssettingThe part of a semantic configuration holding titleField, content fields and keyword fields in priority order.Learn →
Premium featuresportalThe Settings page of a search service where you choose the semantic ranker plan.Learn →
Hierarchical Navigable Small World (HNSW)conceptThe approximate nearest neighbour algorithm that suits most vector indexes.Learn →
Exhaustive K-Nearest Neighbors (KNN)conceptThe algorithm that scans every vector: precise, slower, useful as ground truth.Learn →
exhaustiveKnnsettingThe kind value for an exhaustive KNN algorithm configuration in vectorSearch.algorithms.Learn →
vectorSearchProfilesettingThe vector field property naming the profile that sets its algorithm, compression and vectorizer.Learn →
vectorizerconceptIndex component that turns query text or images into vectors at query time.Learn →
azure-search-documentspackageThe Python client library for querying and managing Azure AI Search indexes.Learn →
VectorizedQueryclassPython vector query built from a vector you computed yourself.Learn →
semantic_configuration_nameparameterThe search() argument naming which semantic configuration the ranker uses.Learn →
Document Layout skillfeatureBuilt-in skill using the Document Intelligence layout model to output Markdown or text with structure.Learn →
Custom Web API skillfeatureA custom skill that sends records to your own HTTPS endpoint during indexing.Learn →
Search Index Data ReaderroleBuilt-in role that lets an identity query an index without a key.Learn →
Every name in the course is on one printable page: download the AI-103 cheat sheet (PDF).
Key Terms

Approximate nearest neighbour (ANN)

A fast vector search that finds very close matches without comparing every vector, trading a little recall for speed.

Index projection

The skillset section that maps enriched chunks, and their fields, into documents in a target index.

Self-Check — Before You Submit
1. A logistics firm’s index holds a few thousand chunks indexed with HNSW. The team wants to measure how many true nearest neighbours HNSW misses. What is the simplest approach?
  • A. Increase top to 50 on a hybrid query
  • B. Add a semantic configuration and compare reranker scores
  • C. Run the same vector queries with exhaustive set to true and compare the results
  • D. Change the similarity metric from cosine to hamming
C. Run the same vector queries with exhaustive set to true and compare the results — Setting exhaustive to true runs exhaustive KNN at query time even on an HNSW field, and Learn names ground-truth building as a use for exhaustive KNN. The semantic ranker re-orders results and says nothing about vector recall.
2. You want natural-language questions re-ranked by meaning on top of your hybrid results. What must exist in the index?
  • A. A vectorizer of kind customWebApi
  • B. A semantic configuration with a title field and prioritized content fields
  • C. An exhaustiveKnn algorithm configuration
  • D. A filterable vector field
B. A semantic configuration with a title field and prioritized content fields — Semantic ranking needs a semantic configuration naming the fields the ranker reads, and the query must set query_type to semantic. Vector fields can never be filterable, so that option is simply invalid.
3. A hospital must run its own de-identification service, hosted on an HTTPS endpoint, over every document during indexing. Which skill fits?
  • A. PII Detection skill only
  • B. Document Layout skill
  • C. OCR skill
  • D. Custom Web API skill
D. Custom Web API skill — The Custom Web API skill calls your own HTTPS endpoint with a JSON values array keyed by recordId. The built-in PII Detection skill is tempting, but it runs Microsoft’s model, not the hospital’s own service.

Today’s Assignment

Run one real question against your Session 25 index as a keyword, a vector and a hybrid-plus-semantic query, compare and explain the results, and add one enrichment skill to the pipeline.
  • Add or confirm a semantic configuration, and paste its JSON from the index definition.
  • Run search_three_ways.py with one question your users genuinely ask, ideally containing a code, name or date.
  • Compare the three lists: is the answering passage in the top three each time? Explain the differences using BM25, vectors, RRF and the semantic ranker, and choose a production mode, with reasons.
  • From the index JSON, describe the vector field, dimensions, profile, algorithm kind and vectorizer kind, and say when you would set exhaustive to true.
  • Add one skill (Key Phrase Extraction, or the Multimodal RAG wizard’s layout and image skills), reset and run the indexer, and show the enriched content in a query result.
  • In two or three sentences, describe a case in an organisation you know that needs a Custom Web API skill rather than a built-in one.
  • Keep the explanation between 300 and 700 words. Use role-based access, not keys; crop endpoints from screenshots and never include keys, secrets or credentials.
Evidence to include
  • The terminal output of search_three_ways.py showing all three runs.
  • A screenshot of the semantic configuration in the portal, or the index JSON showing it and the vector profile.
  • A screenshot of the skillset JSON with the new skill, the indexer’s successful run after the reset, and a query result showing the enriched field.
Names your answer must use exactly
semantic configuration prioritizedFields vectorSearchProfile Hierarchical Navigable Small World (HNSW) vectorizer semantic_configuration_name Custom Web API skill
Never include a key, a connection string or a token. Crop them out of every screenshot. If one is exposed, the letter will tell you to rotate it.
How this is marked — the rubric
The three queries ran correctly and the comparison explains the differences accurately in terms of BM25, vectors, RRF and semantic ranking30
The vector and semantic configuration is described correctly: field, dimensions, profile, algorithm, vectorizer and prioritized fields20
One skill was added and the indexer rerun, with the enriched field shown, and the Custom Web API case is sound20
Uses the exact names from this session’s names box15
Evidence: output and screenshots show all three runs, the configuration and the indexer run, with endpoints cropped and no keys15
Total · pass mark 70100
Submitting session 26
Write your answer in Word or Google Docs, with your screenshots pasted in. The top of the document must carry the line Session: 26 (the template has it ready, under the Course line), or the submission is refused. Upload the Word file (.docx), or switch to the Google Doc tab and paste your document’s share link.
Marked against the rubric above and returned as a written letter by email; the mark appears on your progress page. Do the self-check above before you submit.
Skills Covered
Semantic configurationVector profiles and algorithmsHybrid queries in PythonBuilt-in and custom skillsReindexing after a skillset change
Tick it once you have submitted.Next: Session 27 →
E · Implement information extraction solutions · 10–15%SESSION 27
Wiring retrieval into workflows and agents; multimodal extraction pipelines
Session 27 of 40 · 45-minute session
Skills measured — Microsoft’s wording
  • Connect retrieval pipelines directly to workflows and agent tools
  • Extract information by using multimodal pipelines that combine OCR, layout analysis, and field extraction

Why This Matters

An index on its own answers nobody. The exam objectives here are precise: connect retrieval pipelines directly to workflows and agent tools, and extract information with multimodal pipelines that combine OCR, layout analysis and field extraction. In practice that is two skills. First, giving an agent your index as a tool, with the right connection, roles and query type, or giving it a Foundry IQ knowledge base when one index is not enough. Second, turning a photographed or scanned form into fields you can trust, in stages you can inspect. Today you build an agent that answers from your Session 25 index with citations, and you run a real receipt or form through OCR, layout and field extraction.

IN YOUR SUBSCRIPTION
Creates
A project connection from your Foundry project to your Azure AI Search service; two role assignments on the search service for your Foundry resource’s system-assigned managed identity; one model deployment (Global Standard) for the agent; one prompt agent version, deleted by the script; and a Cognitive Services User role assignment for yourself on the Foundry resource. No new resource type.
Cost
Billed. The search service keeps billing hourly on the Dedicated model. The agent’s model tokens are billed per token, and each tool call runs search queries (semantic ones count against the ranker’s Free plan allowance). Document Intelligence analysis on your Foundry resource is billed by usage. Check the Azure AI Search, Microsoft Foundry and Azure Document Intelligence pricing pages, or the pricing calculator.
Clean-up
The agent script deletes its own agent version. Then delete the chat model deployment and the Session 25 embedding deployment (Build → Models). This is the last session that needs the search service: delete it from Resource groups → rg-ai103 → the search service → Delete, delete the Session 25 storage account the same way, remove the role assignments the search service’s identity held on the Foundry resource (Access control (IAM)), and remove the connection from the project’s Connected resources tab. You can rebuild an index with the wizard for the capstone. Keep the Cognitive Services User role: Session 28 needs it.
The 45-Minute Session
9:00 – 21:00
Hands-on: connect your index and give it to an agent
  • Create the connection. In the Foundry portal open your project, select Manage → Project details → the Connected resources tab → Add connection. Choose Azure AI Search, select your service, choose the Authentication type (use Microsoft Entra ID, not a key), then Add connection. Note the connection name. The Session 10 connection points to a service you have since deleted, so make a new one for the Session 25 service.
  • Grant the roles. For keyless access, Learn says to assign Search Index Data Contributor and Search Service Contributor on the search service to the system-assigned managed identity of your Foundry resource (check it is switched on in the resource’s identity settings in the Azure portal). Learn also warns that key-based connections are not supported with private networking, and that Basic agent setup cannot use a private search resource.
  • Deploy a chat model on Global Standard as in Session 4 and set FOUNDRY_MODEL_NAME. Keep FOUNDRY_PROJECT_ENDPOINT from Week 1 and SEARCH_INDEX from Session 26, and set SEARCH_CONNECTION_NAME (the name Learn’s Azure AI Search tool sample uses, as in Session 10) to the connection you just made. The script follows the shape of that sample, without streaming, and names the agent with agent_reference in extra_body, the pattern from Session 12.
  • pythonsearch_agent.pytype it yourself
    import os
    from azure.identity import DefaultAzureCredential
    from azure.ai.projects import AIProjectClient
    from azure.ai.projects.models import (
        AzureAISearchTool, AzureAISearchToolResource, AISearchIndexResource,
        AzureAISearchQueryType, PromptAgentDefinition,
    )
    
    project = AIProjectClient(
        endpoint=os.environ["FOUNDRY_PROJECT_ENDPOINT"],
        credential=DefaultAzureCredential(),
    )
    openai = project.get_openai_client()
    connection_id = project.connections.get(os.environ["SEARCH_CONNECTION_NAME"]).id
    
    search_tool = AzureAISearchTool(azure_ai_search=AzureAISearchToolResource(
        indexes=[AISearchIndexResource(
            project_connection_id=connection_id,
            index_name=os.environ["SEARCH_INDEX"],
            query_type=AzureAISearchQueryType.VECTOR_SEMANTIC_HYBRID,
        )]
    ))
    agent = project.agents.create_version(agent_name="index-agent", definition=PromptAgentDefinition(
        model=os.environ["FOUNDRY_MODEL_NAME"],
        instructions="Answer only from the search tool, cite every source, "
                     "and say you don't know if the index has no answer.",
        tools=[search_tool],
    ))
    response = openai.responses.create(
        input="<a question your index can answer>",
        tool_choice="required",
        extra_body={"agent_reference": {"name": agent.name, "type": "agent_reference"}},
    )
    print(response.output_text)
    for item in response.output:
        if item.type == "message" and item.content[-1].type == "output_text":
            for annotation in item.content[-1].annotations:
                if annotation.type == "url_citation":
                    print("Citation:", annotation.url)
    project.agents.delete_version(agent_name=agent.name, agent_version=agent.version)
    WHAT YOU SHOULD SEE
    <the agent's answer, built from passages in your index>
    Citation: <a reference to a document in your index>
  • tool_choice="required" forces the agent to use a tool on this turn, which is what you want when testing grounding. If the hybrid query type fails on your index, switch to AzureAISearchQueryType.SIMPLE, run again, and note the difference in your write-up.
  • THE EXAM LINE

    AzureAISearchTool wraps AzureAISearchToolResource, whose indexes list holds AISearchIndexResource(project_connection_id, index_name, query_type). Get the ID with project.connections.get(name).id; the tool targets one index.

  • Ask a question your documents cannot answer as well. A grounded agent should say it does not know; if it invents an answer, tighten the instructions and record what you changed.
A 403 from the tool is nearly always a role on the search service, assigned to the wrong identity. Check whose identity it is before you change anything else.
29:00 – 39:00
Hands-on: a real form through the pipeline
  • Give yourself the Cognitive Services User role on your Foundry resource (Access control (IAM)). The Content Understanding SDK readme says you need it even as the resource owner, and we use the same resource and role in Session 28. The Document Intelligence readme names Cognitive Services Data Reader for a service principal. If your call is refused with a 401 or 403 after the role has had a few minutes to apply, send me the error the same day.
  • Find the endpoint with az cognitiveservices account show --name <your-foundry-resource-name> --resource-group rg-ai103 --query "properties.endpoint" and store it in DOCUMENTINTELLIGENCE_ENDPOINT, the name the SDK readme uses. Install the client with pip install azure-ai-documentintelligence; at the time of writing, the readme shows version 1.0.2, targeting API version 2024-11-30.
  • Use a receipt you photographed yourself, with card numbers and personal details covered. The script follows the layout and receipt examples in the SDK readme, with DefaultAzureCredential in place of a key.
  • pythonform_pipeline.pytype it yourself
    import os
    from azure.identity import DefaultAzureCredential
    from azure.ai.documentintelligence import DocumentIntelligenceClient
    from azure.ai.documentintelligence.models import AnalyzeResult
    
    client = DocumentIntelligenceClient(
        os.environ["DOCUMENTINTELLIGENCE_ENDPOINT"], DefaultAzureCredential()
    )
    PATH = "receipt.jpg"  # your own photo, personal details covered
    
    # Stages 1 and 2: OCR and layout in one call
    with open(PATH, "rb") as f:
        poller = client.begin_analyze_document("prebuilt-layout", body=f)
    layout: AnalyzeResult = poller.result()
    for page in layout.pages:
        print(f"Page {page.page_number}: {len(page.lines or [])} lines")
        for line in (page.lines or [])[:5]:
            print("  OCR:", line.content)
    print("Tables:", len(layout.tables or []))
    if layout.styles and any(style.is_handwritten for style in layout.styles):
        print("Handwritten content found")
    
    # Stage 3: field extraction with a prebuilt model
    with open(PATH, "rb") as f:
        poller = client.begin_analyze_document("prebuilt-receipt", body=f, locale="en-US")
    receipts: AnalyzeResult = poller.result()
    for receipt in receipts.documents or []:
        merchant = receipt.fields.get("MerchantName")
        if merchant:
            print(f"MerchantName: {merchant.get('valueString')} ({merchant.confidence})")
        date = receipt.fields.get("TransactionDate")
        if date:
            print(f"TransactionDate: {date.get('valueDate')} ({date.confidence})")
    WHAT YOU SHOULD SEE
    Page 1: <number> lines
      OCR: <first line of your receipt>
      ...
    Tables: <number>
    MerchantName: <the shop name> (<confidence between 0 and 1>)
    TransactionDate: <the date> (<confidence>)
  • Compare the stages. If the OCR line is right but the merchant field is wrong, extraction is at fault; if the OCR line is wrong, better lighting will fix more than any model. That is why stages stay separate.
  • Layout can also return key-value pairs as an add-on: pass features=[DocumentAnalysisFeature.KEY_VALUE_PAIRS] to begin_analyze_document with prebuilt-layout, as the readme shows. Try it on a form that has no prebuilt model.
  • Keep the output. In Session 28 you run a similar document through Content Understanding and compare the two.
Photograph the form flat, in daylight, filling the frame. Half of all extraction problems are really photography problems.

The exact names

As Microsoft prints them — the exam and the marker both expect these, letter for letter.
AzureAISearchToolclassThe agent tool class that lets a prompt agent query one Azure AI Search index.Learn →
AISearchIndexResourceclassNames the index, its project connection and the query type for the Azure AI Search tool.Learn →
project_connection_idparameterThe ID of the project connection that links the agent tool to a resource.Learn →
vector_semantic_hybridsettingThe default query type of the Azure AI Search tool: vector plus keyword, semantically reranked.Learn →
Search Service ContributorroleRole Learn lists, with Search Index Data Contributor, for the Foundry identity in keyless tool access.Learn →
MCPToolclassThe agent tool class used to connect a Foundry IQ knowledge base over MCP.Learn →
knowledge_base_retrievetoolThe MCP tool a knowledge base exposes for agents to retrieve grounded content.Learn →
knowledge sourceconceptA search service resource defining indexed or remote content that a knowledge base uses.Learn →
KnowledgeBaseRetrievalClientclassThe Azure AI Search SDK client that calls a knowledge base’s retrieve action from your own code.Learn →
Azure Document Intelligence in Foundry ToolsserviceThe Foundry Tool with read, layout, prebuilt and custom models for document extraction.Learn →
DocumentIntelligenceClientclassThe Python client that analyses documents with prebuilt and custom Document Intelligence models.Learn →
begin_analyze_documentmethodStarts a document analysis with a given model ID and returns a poller for the result.Learn →
prebuilt-layoutmodelThe model that returns text, tables, selection marks and document structure.Learn →
prebuilt-receiptmodelThe prebuilt model that extracts fields such as merchant name and transaction date from receipts.Learn →
Every name in the course is on one printable page: download the AI-103 cheat sheet (PDF).
Key Terms

Model Context Protocol (MCP)

An open protocol that lets an agent discover and call tools exposed by a server, such as a knowledge base.

Confidence score

A value from 0 to 1 estimating how likely an extracted value is correct, used to route results for review.

Self-Check — Before You Submit
1. A Lagos bank wants several agents to answer staff questions from SharePoint, a blob container and public web data, returning only content each user is allowed to see, with citations. What should the agents use?
  • A. One Azure AI Search tool per agent, each pointing at one index
  • B. A code interpreter tool with uploaded files
  • C. A Document Intelligence custom model
  • D. A Foundry IQ knowledge base with several knowledge sources, connected as an MCP tool
D. A Foundry IQ knowledge base with several knowledge sources, connected as an MCP tool — Foundry IQ knowledge bases combine multiple knowledge sources, can be shared by several agents, enforce permissions and return citations. The Azure AI Search tool is tempting but targets only one index per tool.
2. You configure the Azure AI Search tool and leave query_type unset. Which query type does the agent use?
  • A. vector_semantic_hybrid
  • B. simple
  • C. semantic
  • D. vector
A. vector_semantic_hybrid — Learn’s parameter table says query_type defaults to vector_semantic_hybrid. Choosing simple is a common guess, but simple is only the value Learn’s sample sets explicitly.
3. A logistics firm scans thousands of standard supplier receipts a day and needs the merchant name and date, each with a confidence score. Which option does Learn’s decision guidance point to?
  • A. The Azure AI Search tool with semantic ranking
  • B. OCR only, with prebuilt-read
  • C. A Document Intelligence prebuilt model such as prebuilt-receipt
  • D. A multimodal chat model prompted for each image
C. A Document Intelligence prebuilt model such as prebuilt-receipt — For standard structured forms that a prebuilt covers, Learn recommends a Document Intelligence prebuilt model. OCR alone returns text but does not label which text is the merchant or the date.

Today’s Assignment

Build an agent that answers from your own index with citations, and run one real form through an OCR, layout and field-extraction pipeline, explaining both.
  • Create the Azure AI Search connection and the two role assignments, then run search_agent.py with two questions: one your documents answer, and one they do not. Keep both outputs.
  • Explain how the agent reaches the index: the connection, the identity and its roles, the tool classes, and the query type you used. Say what changed if you had to switch query types.
  • Explain in a short paragraph when you would replace this tool with a Foundry IQ knowledge base, naming the knowledge sources you would use in an organisation you know.
  • Run form_pipeline.py on a real receipt or form of your own (personal details covered). Show the OCR lines, the layout results and the extracted fields with their confidence.
  • Diagnose one weakness: a misread line, a wrong field or a low confidence. Say which stage caused it, and what you would change (photo quality, a different model, human review below a threshold you choose).
  • Say what you deleted afterwards. Keep the explanation between 300 and 700 words. Crop endpoints and connection IDs from screenshots; never include keys, secrets or credentials.
Evidence to include
  • The terminal output of search_agent.py for both questions, including the citations.
  • Screenshots of the project’s Connected resources tab and the role assignments on the search service.
  • The terminal output of form_pipeline.py, and a photo of the form with personal details covered.
Names your answer must use exactly
AzureAISearchTool AISearchIndexResource project_connection_id knowledge source DocumentIntelligenceClient prebuilt-layout
Never include a key, a connection string or a token. Crop them out of every screenshot. If one is exposed, the letter will tell you to rotate it.
How this is marked — the rubric
The agent answers from the index with citations, declines when the index has no answer, and the wiring (connection, identity, roles, query type) is explained correctly30
The form pipeline runs and the explanation separates OCR, layout and field extraction, with a sound diagnosis of one weakness25
The knowledge base paragraph gives a realistic reason and named knowledge sources10
Uses the exact names from this session’s names box15
Evidence: outputs and screenshots show both parts working, clean-up is stated, and no keys or endpoints are visible20
Total · pass mark 70100
Submitting session 27
Write your answer in Word or Google Docs, with your screenshots pasted in. The top of the document must carry the line Session: 27 (the template has it ready, under the Course line), or the submission is refused. Upload the Word file (.docx), or switch to the Google Doc tab and paste your document’s share link.
Marked against the rubric above and returned as a written letter by email; the mark appears on your progress page. Do the self-check above before you submit.
Skills Covered
Azure AI Search tool for agentsFoundry IQ knowledge basesRetrieval in workflowsOCR, layout and field extractionDocument Intelligence or Content Understanding
Tick it once you have submitted.Next: Session 28 →
E · Implement information extraction solutions · 10–15%SESSION 28
Content Understanding for documents: grounded representations and analyzers
Session 28 of 40 · 45-minute session
Skills measured — Microsoft’s wording
  • Produce clean, grounded representations to use with agents and RAG by using Content Understanding
  • Implement analyzers for generating structured or markdown outputs for downstream reasoning by using Content Understanding

Why This Matters

Agents and RAG pipelines reason over whatever text you give them. Hand them a flattened PDF with its tables scrambled and the answer comes back scrambled too. Azure Content Understanding in Foundry Tools turns documents into clean Markdown that keeps headings, tables and figures, and into typed fields with a confidence score and a pointer back to where each value came from. The exam asks you to produce those grounded representations, and to implement analyzers, prebuilt and custom, that return structured or Markdown output. At work, that grounding is what lets a reviewer check a value in seconds instead of rereading a contract. Today you set up Content Understanding on your Foundry resource, run a prebuilt analyzer, and build a custom one with your own field schema.

IN YOUR SUBSCRIPTION
Creates
Content Understanding default model deployments on your Foundry resource (created by Content Understanding Studio’s autodeployment, or mapped to deployments you already have); the Cognitive Services User role for yourself if Session 27 did not add it; and one custom analyzer, deleted at the end. No new Azure resource: Content Understanding runs on the Foundry resource in rg-ai103.
Cost
Billed by usage. Content Understanding analysis is charged, and the chat and embedding deployments it calls are billed per token on your resource; the analysis result itself reports the pages and tokens used in its usage section. Different analyzers need different models, so costs vary by analyzer. Check the Content Understanding pricing page linked from Learn, the Microsoft Foundry pricing page and the pricing calculator. Use one or two short documents today.
Clean-up
The script deletes the custom analyzer; confirm in Content Understanding Studio that none remain. Keep the default model deployments for Sessions 29 and 30, then delete them at the end of Session 30 (Build → Models). If you are pausing the course, delete them now and repeat the defaults step when you return.
The 45-Minute Session
8:00 – 16:00
Analyzers: prebuilt, custom, and what they are made of
  • Kind of analyzerExamples (exact IDs)Use it when
    Content extractionprebuilt-read, prebuilt-layoutYou need OCR or layout only; Learn says these need no language or embedding model
    RAG analyzersprebuilt-documentSearch (and image, audio and video siblings)You are ingesting for retrieval: Markdown with layout, figure descriptions, a summary, chunk-ready output
    Domain prebuiltprebuilt-invoice, prebuilt-receipt, prebuilt-idDocument, prebuilt-contractThe document type is a known, common one
    Base analyzersprebuilt-document, prebuilt-image, prebuilt-audio, prebuilt-videoYou are building a custom analyzer; you name one as its parent
  • A custom analyzer’s definition has a small set of properties: analyzerId; a description (which the model uses as context); baseAnalyzerId; config; fieldSchema; and models, naming the completion and embedding models to use.
  • Useful config options, from the analyzer reference: returnDetails, enableOcr, enableLayout, enableFigureDescription, tableFormat (html by default, or markdown), and estimateFieldSourceAndConfidence, which returns the source location and confidence for each field.
  • In the field schema, every field has a type, a description and a method. extract takes a value literally from the document; generate produces a value such as a summary; classify chooses from an enum you supply. Write descriptions the way you would brief a new clerk: where the value usually sits and what it looks like.
  • THE EXAM LINE

    Custom analyzer: analyzerId, baseAnalyzerId (for example prebuilt-document), config, fieldSchema and models. Field methods are extract, generate and classify; documents support all three, while image, audio and video support generate and classify.

  • For document analyzers, Learn also documents extractionMode: layout-aware extraction for structured documents where tables and reading order matter, or faster text-only extraction to produce clean Markdown for RAG.
The description field is not decoration. It is the prompt. A vague description gets you a vague value.
23:00 – 30:00
Hands-on: Markdown for RAG with prebuilt-documentSearch
  • Take a short PDF of your own with headings and at least one table: a policy, a price list, a procedure. The script sends the file’s bytes with begin_analyze_binary, the client method for local files, and saves the Markdown.
  • pythoncu_markdown.pytype it yourself
    import os
    from azure.identity import DefaultAzureCredential
    from azure.ai.contentunderstanding import ContentUnderstandingClient
    from azure.ai.contentunderstanding.models import AnalysisResult
    
    client = ContentUnderstandingClient(
        endpoint=os.environ["CONTENTUNDERSTANDING_ENDPOINT"],
        credential=DefaultAzureCredential(),
    )
    
    # A short PDF of your own with headings and at least one table
    with open("policy.pdf", "rb") as f:
        poller = client.begin_analyze_binary(
            analyzer_id="prebuilt-documentSearch",
            binary_input=f.read(),
        )
    result: AnalysisResult = poller.result()
    
    content = result.contents[0]
    print(content.markdown[:1500])  # headings and tables survive as Markdown
    with open("policy.md", "w", encoding="utf-8") as out:
        out.write(content.markdown)
    WHAT YOU SHOULD SEE
    # <your first heading>
    <paragraph text>
    <table rows, as HTML or Markdown depending on the analyzer's table format>
    ...
  • Open policy.md next to the PDF. Are the headings in the right order? Is the table still a table? That structure is what makes the next step work: Learn describes prebuilt-documentSearch as producing chunked output ready for embedding and vector indexing, with layout-aware semantic chunking.
  • Compare it with the Session 27 layout output. Document Intelligence gave you lines and tables as objects; this gave you a document a model can read in one pass.
  • Two ways to use it downstream. In Azure AI Search, the Azure Content Understanding skill (generally available in the 2026-04-01 REST API) runs analyzers inside an indexer. In your own code, Learn’s preview helper to_llm_input() formats field results as Markdown with YAML front matter for a language model.
Always read the Markdown yourself before you index it. Five minutes now saves a week of puzzling over bad answers.
40:00 – 45:00
Wrap-up: write it down, then build your own
  • Write down: the two outputs and who each is for; the GA API version; the four kinds of analyzer with an example ID each; the analyzer properties; the three field methods and which modalities support them; and the client methods to create, analyse and delete.
  • Your assignment: a custom analyzer with a field schema of your own design, run on your own documents, with its output and an explanation.
  • Clean-up: delete your custom analyzer once the evidence is saved (the script does it). Keep the default model deployments for Sessions 29 and 30. Crop your endpoint from screenshots and never paste a key.
  • If the defaults step or autodeployment fails, copy the exact message and the region of your resource, and send it to me the same day.
A schema is a contract with the rest of your system. Name fields the way the downstream team will use them.

The exact names

As Microsoft prints them — the exam and the marker both expect these, letter for letter.
prebuilt-documentSearchmodelThe RAG analyzer that turns documents into Markdown with layout, figure descriptions, a summary and chunk-ready output.Learn →
prebuilt-invoicemodelThe prebuilt analyzer for invoices, utility bills, sales orders and purchase orders.Learn →
prebuilt-layoutmodelContent extraction analyzer for words, paragraphs, tables, figures and structure; needs no language model.Learn →
baseAnalyzerIdsettingThe analyzer property naming the parent analyzer a custom analyzer inherits from.Learn →
fieldSchemasettingThe analyzer property that defines the structured fields to extract, generate or classify.Learn →
estimateFieldSourceAndConfidencesettingConfig option that returns a source location and confidence score for each field.Learn →
ContentUnderstandingClientclassThe Python client for analysing content and creating and managing analyzers.Learn →
begin_create_analyzermethodCreates a custom analyzer from a ContentAnalyzer definition as a long-running operation.Learn →
ContentFieldSchemaclassThe Python class holding a custom analyzer’s named field definitions.Learn →
GenerationMethodclassThe Python enum for a field’s method: extract, generate or classify.Learn →
azure-ai-contentunderstandingpackageThe native Python SDK for Content Understanding, targeting the GA API.Learn →
Content Understanding StudioportalThe web experience for the full prebuilt catalogue and for building custom analyzers.Learn →
2025-11-01settingThe generally available Content Understanding API version, recommended for production.Learn →
Cognitive Services UserroleThe role you must grant yourself on the Foundry resource to call Content Understanding, even as owner.Learn →
Every name in the course is on one printable page: download the AI-103 cheat sheet (PDF).
Key Terms

Field schema

The list of fields an analyzer returns, each with a type, a description and a method.

RAG analyzer

A prebuilt analyzer tuned to produce Markdown and metadata that index and retrieve well.

Self-Check — Before You Submit
1. An insurer wants to index thousands of policy PDFs for an agent, keeping headings and tables intact and adding figure descriptions. Which analyzer is the best starting point?
  • A. prebuilt-read
  • B. prebuilt-documentSearch
  • C. prebuilt-invoice
  • D. A custom analyzer based on prebuilt-video
B. prebuilt-documentSearch — prebuilt-documentSearch is the RAG analyzer for documents: Markdown with layout, figure descriptions, a summary and chunk-ready output. prebuilt-read is tempting but gives basic OCR without layout analysis.
2. In a custom document analyzer, you want a field holding a one-sentence summary that appears nowhere in the document. Which method do you set?
  • A. extract
  • B. classify
  • C. generate
  • D. enableLayout
C. generate — generate produces new content such as a summary. extract only returns values literally present in the document, and enableLayout is a config option, not a field method.
3. A reviewer must be able to see exactly where an extracted total came from on the page. What do you configure?
  • A. estimateFieldSourceAndConfidence set to true
  • B. tableFormat set to markdown
  • C. omitContent set to true
  • D. The GPT-4.1 model family as defaults
A. estimateFieldSourceAndConfidence set to true — estimateFieldSourceAndConfidence returns the source location and a confidence score for each field, which is the grounding a reviewer needs. omitContent removes content from the response, which works against traceability.

Today’s Assignment

Design, build and run a custom Content Understanding analyzer with your own field schema, and produce a grounded Markdown representation of one of your documents.
  • Run cu_markdown.py on a document of your own with headings and a table. Explain in a few sentences how well the Markdown preserved its structure and why that matters for RAG.
  • Design a field schema for a document type from your work, with at least five fields, using all three methods (extract, generate, classify). For each field, give its name, type, method and description, and justify the method.
  • Build the analyzer by adapting create_analyzer.py, then run it on two different documents of that type with run_analyzer.py.
  • Report the values, confidence and source for each extracted field. Choose a confidence threshold below which a person must review the value, and explain your choice.
  • Explain why you chose a custom analyzer rather than a prebuilt one (or a Document Intelligence model) for this document type.
  • Delete the analyzer and say so. Keep the explanation between 300 and 700 words; crop your endpoint from screenshots and never include keys, secrets or credentials.
Evidence to include
  • The start of your saved Markdown file beside a screenshot of the original page.
  • Your field schema code and the terminal output for both documents, showing values, confidence and source.
  • A screenshot showing your default model deployments (Build → Models) or the Content Understanding settings page.
Names your answer must use exactly
prebuilt-documentSearch baseAnalyzerId fieldSchema estimateFieldSourceAndConfidence begin_create_analyzer GenerationMethod
Never include a key, a connection string or a token. Crop them out of every screenshot. If one is exposed, the letter will tell you to rotate it.
How this is marked — the rubric
The custom analyzer works on two documents, and the schema uses extract, generate and classify appropriately with clear descriptions30
The grounding is used correctly: confidence and source are reported and a reasoned review threshold is set20
The Markdown output is evaluated sensibly for RAG, and the choice of a custom analyzer is justified15
Uses the exact names from this session’s names box15
Evidence: Markdown, code, outputs and deployment screenshots are present, the analyzer was deleted, and no keys or endpoints are visible20
Total · pass mark 70100
Submitting session 28
Write your answer in Word or Google Docs, with your screenshots pasted in. The top of the document must carry the line Session: 28 (the template has it ready, under the Course line), or the submission is refused. Upload the Word file (.docx), or switch to the Google Doc tab and paste your document’s share link.
Marked against the rubric above and returned as a written letter by email; the mark appears on your progress page. Do the self-check above before you submit.
Skills Covered
Grounded Markdown for RAGPrebuilt analyzersCustom analyzers and field schemasConfidence and groundingContent Understanding setup
Tick it once you have submitted.Next: Session 29 →
C · Implement computer vision solutions · 10–15%SESSION 29
Content Understanding for images and video: pipelines, segments, objects and regions
Session 29 of 40 · 45-minute session
Skills measured — Microsoft’s wording
  • Implement visual understanding by configuring Azure Content Understanding in Foundry Tools to extract visual characteristics
  • Implement video analysis workflows to process and interpret video segments
  • Configure single‑task and pro‑mode Content Understanding pipelines
  • Implement solutions that identify objects, components, or regions within images or video

Why This Matters

Photographs from a factory floor and hours of recorded video hold facts a business needs, but nobody can type them up at scale. The exam asks you to configure Azure Content Understanding in Foundry Tools to extract visual characteristics from images, to process video as segments, to identify objects, components or regions, and to know what “single-task” and “pro-mode” pipelines are. That last phrase needs care, because the portal and API behind it have changed, and I will show you exactly what Learn says today. At work, this is how a quality team flags a cracked housing from a photo, and how a media team finds every product demonstration in a long recording. Today you build one image analyzer and one video analyzer.

IN YOUR SUBSCRIPTION
Creates
Two custom analyzers on your Foundry resource, one based on prebuilt-image and one on prebuilt-video; both scripts delete them at the end. They use the default model deployments from Session 28. No new Azure resource.
Cost
Billed by usage: image and video analysis, plus the tokens of the models the analyzers call. Video cost grows with length, so use a clip of a minute or two. At the time of writing, Learn’s limits page allows files up to 200 MB and 30 minutes when you upload directly; you need nowhere near that. Check the Content Understanding pricing page linked from Learn and the Microsoft Foundry pricing page.
Clean-up
Confirm both analyzers were deleted (the scripts do it; Content Understanding Studio lists any that remain). Keep the default model deployments for Session 30. Delete any test video you uploaded anywhere public, and keep people’s faces out of your sample files.
The 45-Minute Session
8:00 – 16:00
“Single-task” and “pro mode”: what the objective means today
  • The study guide objective reads: “Configure single‑task and pro‑mode Content Understanding pipelines”. Here is the history, from Learn. The 2025-05-01-preview API introduced two modes, standard (the default) and pro. Standard mode handled documents, images, video and audio, optimised for cost and latency. Pro mode added multi-step reasoning, multiple input documents and reference data supplied when the analyzer is created, for documents only, and without grounding and confidence scores.
  • The retired Foundry (classic) portal built standard-mode analyzers as a single-file task, and its Content Understanding page now redirects elsewhere. I could not find the phrase “single-task” on any current Content Understanding page on Learn, so read the exam’s “single-task” as standard mode: one file, direct extraction.
  • What changed: Learn says the preview APIs 2024-12-01-preview and 2025-05-01-preview were to be retired by 15 July 2026, that pro mode is available only in 2025-05-01-preview, and that Foundry (classic) was deprecated on 15 July 2026 and is no longer a Content Understanding experience. The GA analyzer reference (2025-11-01) has no mode property.
  • Learn publishes no one-to-one replacement table, so the one below is my mapping from each part of the exam wording to the closest feature Learn documents today.
  • Exam wordingClosest feature Learn documents nowAPI version
    Single-task (standard mode)A standard analyzer: one input per analyze call, extract, generate and classify fields, with grounding and confidence for documents2025-11-01 (GA)
    Pro mode: multi-step reasoningAgentic mode: set config.workflow to agentic on a document analyzer for multistep calculations, validation against conditions and complex tables or figures; one input file per request in the initial preview2026-06-01-preview
    Pro mode: several documents in one runClassification and segmentation with contentCategories, routing sections of a file to purpose-built analyzers2025-11-01 (GA)
    Pro mode: reference dataLabelled samples (in-context learning), which the migration guide now calls a type of knowledgeSources2025-11-01 (GA)
  • THE EXAM LINE

    If asked: standard (single-file) mode suits one file with direct extraction and supports grounding and confidence; pro mode added multi-step reasoning, multiple inputs and reference data, for documents only. Today, Learn documents agentic mode for multi-step reasoning.

  • Be honest with yourself about the exam. A question written to the older wording may still appear. Answer it with the standard-versus-pro distinctions above, and in a real project, build on the GA API and use agentic mode only where a preview is acceptable.
When Microsoft retires a feature, the exam lags behind the docs. Know both the old name and what replaced it.
26:00 – 38:00
Hands-on: video segments
  • Learn describes two ways to slice a video. Whole-video: enableSegment is false, and the whole file is one segment. Custom segmentation: enableSegment is true, and you describe the segments you want in natural language in contentCategories, optionally naming an analyzerId per category. When segmentation is on, a content object is returned for each segment.
  • Each video content object is an AudioVisualContent in Python, with start_time_ms, end_time_ms, category and fields; with return_details on, it also carries key_frame_times_ms, camera_shot_times_ms and transcript_phrases.
  • Record a one- or two-minute clip on your phone: a short introduction, then a demonstration of an object, then a closing line. No other people in shot.
  • pythonvideo_segments.pytype it yourself
    import os
    from azure.identity import DefaultAzureCredential
    from azure.ai.contentunderstanding import ContentUnderstandingClient
    from azure.ai.contentunderstanding.models import (
        ContentAnalyzer, ContentAnalyzerConfig, ContentCategoryDefinition,
        ContentFieldSchema, ContentFieldDefinition, ContentFieldType, GenerationMethod,
    )
    
    client = ContentUnderstandingClient(
        endpoint=os.environ["CONTENTUNDERSTANDING_ENDPOINT"],
        credential=DefaultAzureCredential(),
    )
    ANALYZER_ID = "ai103_s29_video"
    config = ContentAnalyzerConfig(return_details=True, enable_segment=True, content_categories={
        "product-demo": ContentCategoryDefinition(
            description="A part of the video where an object is shown or demonstrated"),
        "other": ContentCategoryDefinition(
            description="Everything else, such as the introduction and closing"),
    })
    summary = ContentFieldDefinition(
        type=ContentFieldType.STRING, method=GenerationMethod.GENERATE,
        description="What happens in this segment, in one sentence")
    client.begin_create_analyzer(analyzer_id=ANALYZER_ID, resource=ContentAnalyzer(
        base_analyzer_id="prebuilt-video", config=config,
        field_schema=ContentFieldSchema(name="segments", fields={"summary": summary}),
        models={"completion": "gpt-5.2", "embedding": "text-embedding-3-large"},
    )).result()
    
    with open("clip.mp4", "rb") as f:
        result = client.begin_analyze_binary(analyzer_id=ANALYZER_ID, binary_input=f.read()).result()
    for content in result.contents:
        field = (content.fields or {}).get("summary")
        print(f"{content.start_time_ms}-{content.end_time_ms} ms [{content.category}]",
              field.value if field else "")
    client.delete_analyzer(analyzer_id=ANALYZER_ID)
    WHAT YOU SHOULD SEE
    0-8000 ms [other] <a short introduction>
    8000-52000 ms [product-demo] <what is demonstrated>
    52000-60000 ms [other] <closing remarks>
  • If a segment comes back without a summary, give that category its own analyzerId pointing at an analyzer that holds the field schema, as Learn’s news-segmentation example does, and say so in your write-up.
  • Before building your own, try prebuilt-videoSearch on the same clip in Content Understanding Studio: it segments automatically by topic, scene or visual cues and summarises each segment. Compare its boundaries with yours.
  • THE EXAM LINE

    Custom video segmentation needs enableSegment set to true and contentCategories with a natural-language description per category. Each segment returns its own content object with start and end times in milliseconds.

Describe segments by what happens in them, not by time. “Every product demonstration” survives an edit; “the second minute” does not.

The exact names

As Microsoft prints them — the exam and the marker both expect these, letter for letter.
prebuilt-imagemodelThe base analyzer a custom image analyzer inherits from.Learn →
prebuilt-videomodelThe base analyzer a custom video analyzer inherits from.Learn →
prebuilt-imageSearchmodelThe RAG analyzer that generates a one-paragraph description and insights for an image.Learn →
prebuilt-videoSearchmodelThe RAG analyzer that segments video automatically and returns transcripts and per-segment summaries.Learn →
enableSegmentsettingConfig switch that turns on video segmentation by contentCategories.Learn →
contentCategoriessettingNatural-language category descriptions used to segment or classify content, optionally routed to other analyzers.Learn →
cameraShotTimesMsconceptVideo output listing the timestamps, in milliseconds, where camera shots change.Learn →
keyFrameTimesMsconceptVideo output listing the timestamps of the key frames extracted for analysis.Learn →
pro modefeaturePreview mode (2025-05-01-preview) adding multi-step reasoning, multiple inputs and reference data, for documents only.Learn →
agentic modefeaturePreview document-analyzer workflow (config.workflow set to agentic) that reasons over a document for multistep answers.Learn →
AudioVisualContentclassThe Python result class for audio and video content, with timing and, for video, frame details.Learn →
Object detectionfeatureImage Analysis 4.0 feature returning bounding box coordinates for detected objects; retiring in 2028.Learn →
Every name in the course is on one printable page: download the AI-103 cheat sheet (PDF).
Key Terms

Shot

A stretch of video between camera changes, found automatically by shot detection.

Standard mode

The original default Content Understanding mode: efficient extraction from one file, with grounding and confidence.

Self-Check — Before You Submit
1. A broadcaster wants each 45-minute news programme split into individual stories, with a one-sentence summary per story. What do you configure?
  • A. A custom image analyzer with a classify field
  • B. A custom video analyzer with enableSegment set to true and a contentCategories entry describing a news story
  • C. prebuilt-read with enableLayout set to true
  • D. A video analyzer with enableSegment set to false
B. A custom video analyzer with enableSegment set to true and a contentCategories entry describing a news story — Custom segmentation needs enableSegment set to true and a natural-language description in contentCategories; each segment then returns its own content object. With enableSegment false the whole video is treated as one segment.
2. Which Content Understanding capability, introduced in the 2025-05-01-preview API, supported multiple input documents and reference data supplied at analyzer creation?
  • A. Standard mode
  • B. Agentic mode
  • C. prebuilt-imageSearch
  • D. Pro mode
D. Pro mode — Pro mode added multi-step reasoning, multiple input documents and reference data, for documents only. Standard mode processes one file and lacks those features, and agentic mode is the newer preview for multi-step reasoning, not a 2025-05-01-preview feature.
3. A plant manager needs pixel coordinates around every missing bolt in inspection photos. Which statement matches Learn?
  • A. Use an object detection capability that returns bounding box coordinates, and plan for Image Analysis 4.0 and Custom Vision retiring in September 2028
  • B. Use a Content Understanding image field with the extract method to return coordinates
  • C. Ask a multimodal chat model, which Learn says excels at precise spatial localisation
  • D. Use prebuilt-videoSearch on a still image
A. Use an object detection capability that returns bounding box coordinates, and plan for Image Analysis 4.0 and Custom Vision retiring in September 2028 — Object detection returns bounding box coordinates, and Learn gives retirement dates for both options. Image fields do not support extract, and Learn lists precise spatial localisation as a weakness of vision-enabled chat models.

Today’s Assignment

Build and run one image or video Content Understanding analyzer of your own design on your own files, and explain which mode you would choose for your scenario.
  • Pick a real scenario from an organisation you know: inspection photos, shelf photos, site photos, training videos or recorded demonstrations. Describe it in two or three sentences.
  • Design the schema: at least three fields using only generate and classify, with clear descriptions. For video, define at least two contentCategories and turn on enableSegment.
  • Build and run it on at least two of your own files (for video, one clip with at least two segments is enough). Show the output, and for video list each segment with its start and end times.
  • Explain how your analyzer identifies objects, components or regions, and say whether you would need bounding boxes, and if so which capability you would use and what its retirement means for your plan.
  • Explain the mode choice: which the exam calls single-task (standard) or pro mode, what Learn documents now (the GA analyzer, and agentic mode in preview), and which you would use for your scenario and why.
  • Delete the analyzer and say so. Keep the explanation between 300 and 700 words; keep people’s faces and personal documents out of your files; crop endpoints and never include keys, secrets or credentials.
Evidence to include
  • Your analyzer definition code and the terminal output for each file.
  • For video: the list of segments with start and end times and their categories; for images: the photos you used.
  • A screenshot of Content Understanding Studio or your terminal showing the analyzer was deleted.
Names your answer must use exactly
prebuilt-image prebuilt-video enableSegment contentCategories pro mode agentic mode
Never include a key, a connection string or a token. Crop them out of every screenshot. If one is exposed, the letter will tell you to rotate it.
How this is marked — the rubric
The analyzer runs on the student’s own files, the schema uses only generate and classify appropriately, and segmentation (for video) works30
The objects, components or regions explanation is correct, including when bounding boxes need a different capability15
The mode explanation correctly distinguishes standard and pro mode and states what Learn documents now20
Uses the exact names from this session’s names box15
Evidence: code, outputs and deletion are shown, with no faces, personal data, keys or endpoints visible20
Total · pass mark 70100
Submitting session 29
Write your answer in Word or Google Docs, with your screenshots pasted in. The top of the document must carry the line Session: 29 (the template has it ready, under the Course line), or the submission is refused. Upload the Word file (.docx), or switch to the Google Doc tab and paste your document’s share link.
Marked against the rubric above and returned as a written letter by email; the mark appears on your progress page. Do the self-check above before you submit.
Skills Covered
Image analyzersVideo segmentationStandard, pro and agentic modesObjects, components and regionsPrebuilt image and video search
Tick it once you have submitted.Next: Session 30 →
C · Implement computer vision solutions · 10–15%SESSION 30
Multimodal understanding: visual context, captions, visual Q&A, alt-text
Session 30 of 40 · 45-minute session
Skills measured — Microsoft’s wording
  • Build a solution that analyzes visual context by using multimodal models
  • Configure apps to produce concise or detailed captions for single or multiple images
  • Implement a solution that enables question‑answering grounded in visual evidence
  • Configure generation of alt‑text and extended image descriptions aligned to accessibility guidelines

Why This Matters

Sometimes the right tool is not a pipeline but a question: what is in this picture, what does this dashboard say, is the needle on this gauge in the red? Multimodal models answer that directly. AI-103 asks you to build apps that analyse visual context, write concise or detailed captions for one image or many, answer questions grounded in what is visibly there, and generate alt text and extended descriptions that follow accessibility guidance. That last skill is not decoration. People who use screen readers depend on it, and a wrong description can mislead them. Today you build one script that does all four, and you check its alt text against the guidance Microsoft publishes.

IN YOUR SUBSCRIPTION
Creates
Nothing new if you kept the Session 28 default deployments: you call a vision-enabled model deployment (for example the gpt-5.2 deployment Content Understanding set up) through your Foundry project. Otherwise, one deployment of a vision-enabled model on Global Standard, as in Session 4.
Cost
Billed per token, and images count as input. Learn’s Responses how-to says the low detail level uses the fewest tokens and responds fastest, while high uses more tokens. Use small images and low unless you need fine detail. Check the Microsoft Foundry pricing page for your model.
Clean-up
This session closes the Content Understanding and vision block. Delete every model deployment created in Sessions 28 to 30 (Foundry portal → Build → Models → open each → delete), and confirm in Content Understanding Studio that no custom analyzers remain. Keep rg-ai103 and the project for Week 7.
The 45-Minute Session
7:00 – 15:00
Captions: concise or detailed, one image or many
  • A caption is a length and a purpose. A concise caption names the subject in a line; a detailed caption covers setting, objects, actions and any readable text. You control this with instructions, and with the image detail level.
  • In the Responses API, the user message’s content holds an input_text part and one or more input_image parts (a URL, or a base64 data URL as in Session 5). For several images, add several input_image parts. At the time of writing, the Responses how-to allows up to 50 images per request, each under 50 MB and together under 50 MB; the older vision how-to for Chat Completions states 10 images per call and 20 MB per image, so check the page for the API you use.
  • The detail property on an input_image part controls processing. low uses a lower-resolution version: fewest tokens and fastest, but fine details may be missed. high captures finer detail at more tokens and time. auto is the default and lets the model choose.
  • Learn’s Image prompt engineering techniques page lists the moves that improve captions: Contextual specificity, task-oriented prompts, handling refusals, adding examples, breaking down requests, and defining the output format. Its advice for single-image prompts includes placing the image before the text.
  • pythonmulti_caption.pytype it yourself
    import base64, os
    from azure.identity import DefaultAzureCredential
    from azure.ai.projects import AIProjectClient
    
    project = AIProjectClient(
        endpoint=os.environ["FOUNDRY_PROJECT_ENDPOINT"],
        credential=DefaultAzureCredential(),
    )
    openai = project.get_openai_client()
    
    def image_part(path, detail="low"):
        with open(path, "rb") as f:
            data = base64.b64encode(f.read()).decode("utf-8")
        return {"type": "input_image", "image_url": f"data:image/jpeg;base64,{data}", "detail": detail}
    
    paths = ["site-1.jpg", "site-2.jpg", "site-3.jpg"]
    content = [image_part(p) for p in paths]
    content.append({"type": "input_text", "text":
        "These photos are from a warehouse safety walk. For each image, in order, "
        "write a concise caption of at most 12 words. Then write one detailed "
        "paragraph comparing all three."})
    
    response = openai.responses.create(
        model=os.environ["FOUNDRY_MODEL_NAME"],  # a vision-enabled deployment
        input=[{"role": "user", "content": content}],
    )
    print(response.output_text)
    WHAT YOU SHOULD SEE
    1. <concise caption for site-1>
    2. <concise caption for site-2>
    3. <concise caption for site-3>
    <one detailed paragraph comparing the three>
  • THE EXAM LINE

    Several images go in one user message as several input_image parts. The detail property takes low (fewest tokens), high (finer detail) or auto (the default).

Say who will read the caption. “For a safety manager” and “for a sales brochure” produce very different, equally correct captions.
22:00 – 30:00
Alt text and extended descriptions: the guidance to follow
  • The guidance Microsoft publishes on Learn is the Microsoft Style Guide page Alternative text (alt text). It defines alt text as a textual replacement for images that gives users who can’t view them an equivalent experience, and says good alt text conveys the image’s purpose concisely; it requires interpretation and judgement, not every detail.
  • Its rules, in brief: add alt text to every image that conveys meaning; purely decorative images need none, and on the web use null alt text (alt="") rather than omitting the attribute; begin with a capital letter and end with a period; don’t start with a general word such as “Image”, but do say what it is (photograph, diagram, chart, screenshot); don’t use the file name; include embedded text if the surrounding content doesn’t; limit the length to 150 characters; don’t repeat surrounding text or the caption.
  • For complex images, the same guide says to put a detailed description in the surrounding text or in linked content. Its Graphics, design, and media page adds that complex elements need detailed descriptions in the surrounding text or a separate linked document, and cites the Web Content Accessibility Guidelines (WCAG) 2.0 for tables. That detailed description is your extended description.
  • THE EXAM LINE

    Alt text: purpose first, 150 characters or fewer, no leading ‘Image’, no file names, include essential embedded text. Decorative images get alt="". Complex images get an extended description in surrounding or linked content.

  • Context changes the right answer. The same photo of a loading bay needs different alt text on a recruitment page than in a safety bulletin, so give the model the context. And because Learn warns that vision-enabled models may produce incorrect descriptions, a person checks alt text before it is published.
Read your alt text aloud with your eyes closed. If it does not tell you why the picture is there, rewrite it.
40:00 – 45:00
Wrap-up: Pop Quiz 5, your assignment, and clean-up
  • Write down: when to use a vision-enabled model instead of Content Understanding; the input_text and input_image parts; the three detail values; the documented limitations; the alt-text rules, including 150 characters and alt="" for decorative images; and where extended descriptions go.
  • This session closes Week 6 and opens Pop Quiz 5: Search and Understanding. It covers Sessions 26 to 30. Sit it before Session 31, closed book, with Coach Ritchie switched off.
  • Your assignment: a script that captions and answers questions about your own images, with alt text that follows the Microsoft Style Guide, and your review of it.
  • Clean-up: delete every model deployment from Sessions 28 to 30 (Build → Models), and confirm no custom analyzers remain. Keep rg-ai103 and the project. Crop endpoints from screenshots and never paste a key.
  • Next week we move from understanding images to generating them. If anything from this week is still failing, send me the error today, before the quiz.
Week 6 done: you found, extracted, segmented and described. Those are the verbs that keep a model honest.

The exact names

As Microsoft prints them — the exam and the marker both expect these, letter for letter.
Vision-enabled chat modelsmodelLarge multimodal models that analyse images and answer questions about them in text.Learn →
GPT-5 seriesmodelOne of the model families Learn lists as vision-enabled.Learn →
input_textparameterThe Responses API content part type for text sent alongside images.Learn →
detailparameterThe input_image property that sets the detail level: low, high or auto.Learn →
responses.parsemethodResponses call that parses the model’s output into a Pydantic model you supply.Learn →
text_formatparameterThe responses.parse argument that takes the Pydantic model defining the output schema.Learn →
output_parsedparameterThe response property holding the parsed structured result.Learn →
Contextual specificityconceptImage prompting technique: add the scenario’s context so the output fits its purpose.Learn →
Alternative text (alt text)conceptThe Microsoft Style Guide’s guidance on text replacements for images.Learn →
Web Content Accessibility Guidelines (WCAG) 2.0conceptThe W3C accessibility standard the Microsoft Style Guide cites.Learn →
Azure Vision in Foundry ToolsserviceThe Foundry Tool whose Image Analysis 4.0 captioning is deprecated and retires in September 2028.Learn →
Every name in the course is on one printable page: download the AI-103 cheat sheet (PDF).
Key Terms

Alt text

A short text replacement for an image that conveys its purpose to people who cannot see it.

Decorative image

An image that adds no information; on the web it takes empty alt text, alt="".

Self-Check — Before You Submit
1. A public agency publishes a complex infographic on housing statistics. Which approach follows the Microsoft Style Guide?
  • A. Alt text that lists every number in the chart, however long
  • B. Alt text that starts with “Image of a chart” and repeats the page heading
  • C. Concise alt text that says it is a chart and gives its key message, with a detailed description in the surrounding text or a linked page
  • D. No alt text, because the chart is decorative
C. Concise alt text that says it is a chart and gives its key message, with a detailed description in the surrounding text or a linked page — The guide limits alt text to 150 characters, says to name the image type without starting with a general word such as Image, and puts detail for complex images in surrounding or linked content. An informative chart is never decorative.
2. Your app captions hundreds of thumbnails a day and fine detail does not matter. Which setting reduces token use?
  • A. detail set to low on each input_image part
  • B. detail set to high on each input_image part
  • C. Sending each thumbnail as input_text
  • D. detail set to auto on each input_image part
A. detail set to low on each input_image part — Learn says low uses a lower-resolution version with the fewest tokens and fastest response. auto is the default and lets the model choose, so it does not guarantee the saving.
3. Which request does Learn document as a limitation of vision-enabled chat models?
  • A. Describing the objects in a photograph
  • B. Answering a question about a product label written in English
  • C. Comparing two images sent in one request
  • D. Identifying the exact positions of pieces on a chessboard
D. Identifying the exact positions of pieces on a chessboard — Learn lists precise spatial localisation, with chess positions as its example, among the limitations. Describing and comparing images are ordinary tasks for these models.

Today’s Assignment

Build a script that captions and answers questions about your own images, generates alt text and extended descriptions that follow the Microsoft Style Guide, and review the results.
  • Choose three photos of your own that would be published by an organisation you know (for example on a website or in a bulletin). No faces, documents or personal data. State the publishing context for each.
  • Run multi_caption.py on all three together, and visual_assistant.py on each, with one question per photo that the image can answer and one it cannot.
  • Review each alt text against the Style Guide rules (length, purpose, image type, no leading “Image”, no file name, embedded text, no repetition). Where one fails, change the prompt, rerun, and show before and after.
  • Explain how your answers are grounded in visual evidence, and how the script handled the question it could not answer.
  • Compare low and high detail on one photo: what changed in the answer, and what you would choose in production and why.
  • Explain when you would use Content Understanding or an object detection capability instead of this approach. Say which deployments you deleted. Keep the explanation between 300 and 700 words; crop endpoints and never include keys, secrets or credentials.
Evidence to include
  • The three photos, and the terminal output of both scripts for each.
  • Your alt-text review table, including any before-and-after rewrite.
  • A screenshot of Build → Models after clean-up showing the deployments were deleted.
Names your answer must use exactly
Vision-enabled chat models input_text detail responses.parse text_format Alternative text (alt text)
Never include a key, a connection string or a token. Crop them out of every screenshot. If one is exposed, the letter will tell you to rotate it.
How this is marked — the rubric
The scripts run on the student’s own images and produce concise and detailed captions, grounded answers and a correct refusal for the unanswerable question30
The alt text and extended descriptions follow the Microsoft Style Guide, and the review applies its rules accurately25
The detail comparison and the choice between this approach, Content Understanding and object detection are sound10
Uses the exact names from this session’s names box15
Evidence: photos, outputs, review table and clean-up screenshot are present, with no personal data, keys or endpoints visible20
Total · pass mark 70100
Submitting session 30
Write your answer in Word or Google Docs, with your screenshots pasted in. The top of the document must carry the line Session: 30 (the template has it ready, under the Course line), or the submission is refused. Upload the Word file (.docx), or switch to the Google Doc tab and paste your document’s share link.
Marked against the rubric above and returned as a written letter by email; the mark appears on your progress page. Do the self-check above before you submit.
ASSESSMENT NOW OPEN

Pop Quiz 5 — Search and Understanding opens now. Sit it before the next session. It is how you find out what has stuck, and practice papers may be resat as often as you like.

8 questions · 12 minutes · covers Sessions 26–30 · pass mark 70
Sit Pop Quiz 5 →Closed book, no notes, and Coach Ritchie switches himself off while you sit it.
Skills Covered
Vision-enabled modelsConcise and detailed captionsGrounded visual Q&AAlt text and extended descriptionsStructured output with responses.parse
Tick it once you have submitted.Next: Session 31 →
← Back to course home