Lesson 20 of 26 · see all lessons
  1. Start here: the exam, Python basics and responsible AI (skill area 1, 40-45%)

    1. 1. Start here: the AI-901 exam, the plan and what you already know
    2. 2. The Python and Azure basics AI-901 expects
    3. 3. Responsible AI: the six principles in practice
  2. AI models: how they work, choosing and deploying (skill area 1)

    1. 4. How generative AI models work
    2. 5. Choosing the right AI model for the job
    3. 6. Deploying a model: deployment options and configuration parameters
  3. AI workloads: text, speech, vision and extraction (skill area 1)

    1. 7. Common AI workloads: from chat and agents to vision and extraction
    2. 8. Text analysis: key phrases, entities, sentiment and summaries
    3. 9. Speech: recognition and synthesis
    4. 10. Computer vision and image generation
    5. 11. Extracting information from documents, images, audio and video
  4. Generative AI apps and agents in Foundry (skill area 2, 55-60%)

    1. 12. Writing system and user prompts
    2. 13. Deploying a model and chatting with it in the Foundry portal
    3. 14. Building a lightweight chat client with the Foundry SDK
    4. 15. Creating and testing a single agent in the Foundry portal
    5. 16. Building a lightweight client app for an agent
  5. Text, speech, vision and extraction apps in Foundry (skill area 2)

    1. 17. Building a text analysis app
    2. 18. Building speech apps: spoken prompts and Azure Speech
    3. 19. Building vision apps: images in prompts and generated images
    4. 20. Extracting information with Content Understanding: documents and forms
    5. 21. Content Understanding for images, audio and video, and a small extraction app
  6. Final review and four mock exams

    1. 22. Final review and exam day: every decision on one page
    2. 23. Mock exam 1
    3. 24. Mock exam 2
    4. 25. Mock exam 3
    5. 26. Mock exam 4
See the leaderboard

18 min

Extracting information with Content Understanding: documents and forms

Use Azure Content Understanding analyzers and field schemas to pull fields from documents and forms.

By the end of this lesson you can

  • Explain what Azure Content Understanding and an analyzer are
  • Choose a prebuilt analyzer or define a field schema for a custom one
  • Read Python that creates an analyzer, analyzes a form and reads fields with confidence
  • Choose between Content Understanding and Document Intelligence

From earlier lessons · 1 of 2

Your vision app must send a local photo to a vision-capable model with the Responses API. How do you pass the photo?

Pick one answer.

From earlier lessons · 2 of 2

What is the difference between OCR and field extraction?

Pick one answer.

Every morning, two Fernhill Travel staff retype paper booking forms and supplier invoices into the booking system. They make typos, and the busy season is coming. The operations lead asks whether a tool can read the forms and hand over clean fields, with a flag when it isn't sure. That tool is Azure Content Understanding.

[2]

What Content Understanding is

Exam depth: know it cold.

Azure Content Understanding is a Foundry Tool that uses generative AI to turn documents, images, audio and video into a structured output you define. You need a Microsoft Foundry resource and deployed models it can use, such as a GPT model and an embedding model.

It returns two kinds of output:

  • Content: the text and layout as Markdown, including tables and paragraphs.
  • Fields: named values, such as a total or a customer name, with confidence scores from 0 to 1 and grounding, the spot in the file each value came from.

The current GA API version is 2025-11-01. Newer features arrive in a preview version first.

[60][123]

Rendering diagram…
An analyzer runs content extraction, then field extraction against a schema, and returns Markdown plus fields with confidence and grounding.

[60]

Analyzers: prebuilt or custom

Exam depth: know it cold.

An analyzer is a reusable configuration that says what content to process, what to extract and how to shape the output. You call it by its analyzer ID.

KindExamplesUse it when
Content extractionprebuilt-read, prebuilt-layoutYou need only text, or text with tables and structure.
Domain-specificprebuilt-invoice, prebuilt-receipt, prebuilt-idDocumentA common document type already has a model.
RAGprebuilt-documentSearchYou feed content into search or a chat assistant.
Baseprebuilt-document, -image, -audio, -videoYou build your own analyzer on top of one.
Customfernhill_bookingYour own form, with fields you define.

Decision rule: a standard document type means a prebuilt analyzer. Your own form or fields means a custom analyzer built on prebuilt-document.

[95][122]

Fernhill Travel receives supplier invoices in many layouts. The team needs vendor name, invoice total and line items, with the least setup. Which analyzer should you use?

Pick one answer.

[95][122]

Field schemas: extract, generate, classify

Exam depth: know it cold.

A field schema lists the fields a custom analyzer returns. Each field has:

  • A name, such as total_price.
  • A type: string, number, boolean, date, object or array.
  • A description, which works as a mini-prompt telling the model what to look for.
  • A method:
    • extract: copy the value as it appears, such as a date on a receipt. Documents only.
    • generate: write a value from the content, such as a summary.
    • classify: pick one value from a fixed list, set with enum.

Extract fields need source and confidence turned on, so you get grounding and a confidence score for them.

[60][122]

python
from azure.ai.contentunderstanding.models import (
ContentFieldSchema, ContentFieldDefinition, ContentFieldType, GenerationMethod,
)
field_schema = ContentFieldSchema(
name="booking_form_schema",
description="Fields from a Fernhill Travel booking form",
fields={
"lead_traveler": ContentFieldDefinition(
type=ContentFieldType.STRING, method=GenerationMethod.EXTRACT,
description="Full name of the lead traveler",
estimate_source_and_confidence=True),
"total_price": ContentFieldDefinition(
type=ContentFieldType.NUMBER, method=GenerationMethod.EXTRACT,
description="Total price of the booking",
estimate_source_and_confidence=True),
"trip_type": ContentFieldDefinition(
type=ContentFieldType.STRING, method=GenerationMethod.CLASSIFY,
description="Kind of trip booked", enum=["tour", "cruise", "other"]),
"special_requests": ContentFieldDefinition(
type=ContentFieldType.STRING, method=GenerationMethod.GENERATE,
description="One-sentence summary of any special requests"),
},
)
Output: none yet. This defines a schema object with four fields that the next snippet attaches to an analyzer.

[122][125]

Match

Match each booking-form field to the method it should use.

Pick an item on the left, then its match on the right.

[122]

A field must hold one of four values: "refund", "change", "complaint" or "other". Which method should the field use?

Pick one answer.

Read the code: create an analyzer and analyze a form

python
import os
from azure.ai.contentunderstanding import ContentUnderstandingClient
from azure.ai.contentunderstanding.models import ContentAnalyzer, ContentAnalyzerConfig
from azure.core.credentials import AzureKeyCredential
client = ContentUnderstandingClient(
endpoint=os.environ["CONTENTUNDERSTANDING_ENDPOINT"],
credential=AzureKeyCredential(os.environ["CONTENTUNDERSTANDING_KEY"]),
)
analyzer = ContentAnalyzer(
base_analyzer_id="prebuilt-document",
description="Fernhill Travel booking forms",
config=ContentAnalyzerConfig(return_details=True),
field_schema=field_schema,
models={"completion": "gpt-5.2", "embedding": "text-embedding-3-large"},
)
client.begin_create_analyzer(analyzer_id="fernhill_booking", resource=analyzer).result()
with open("booking_form.pdf", "rb") as f:
poller = client.begin_analyze_binary(analyzer_id="fernhill_booking", binary_input=f.read())
result = poller.result()
for name, field in result.contents[0].fields.items():
print(name, field.value, field.confidence)
Output: one line per field, such as "lead_traveler Priya Shah 0.97" and "trip_type tour". Generated and classified fields may show no confidence.

[123][125]

Exam depth: know it cold.

  • Line 2 imports ContentUnderstandingClient from azure-ai-contentunderstanding, installed with pip.
  • Lines 6-9 create the client from the endpoint and key. DefaultAzureCredential() also works.
  • Lines 10-16 define the analyzer: base prebuilt-document, a description, the schema from the last snippet, and the model names it uses.
  • Line 17 creates it under the ID fernhill_booking and waits with .result().
  • Lines 19-21 send the PDF's bytes with begin_analyze_binary. For a file online, use begin_analyze with inputs=[AnalysisInput(url=...)].
  • Analysis is a long-running operation: the begin_ call returns a poller, and .result() waits until the analysis finishes.
  • Lines 23-24 read result.contents[0].fields. Each field has .value, .confidence and .source.

[123][124][125]

In the analyzer app, which line waits for the analysis to finish before you read fields?

Pick one answer.

[123]

[60][95][122][124]

Retyping 200 booking forms by hand vs one analyzer with a field schema. Picture: Vintage instruction-manual drawing, black ink line art on cream paper.

Try it in the Foundry portal

Exam depth: recognize it.

  1. Go to Microsoft Foundry and open or create a project.
  2. Select Build, then Models on the left.
  3. Select the AI Services tab, then the Content Understanding playground.
  4. Select the gear icon and pick or deploy the models the analyzers need.
  5. Run an analyzer on the sample data, or upload a booking form.
  6. Examine the results formatted or as raw JSON.
  7. Delete the resource group when you finish, to stop charges.

Foundry shows Read, Layout and a subset of prebuilt analyzers. To build a custom analyzer with a schema and labeled samples, use Content Understanding Studio, its companion portal.

[60][126]

Content Understanding or Document Intelligence?

Exam depth: recognize it.

Azure Document Intelligence uses models trained for document parsing. It returns fields deterministically, fast, with no generative AI. Microsoft now presents it as part of the Content Understanding family.

Document IntelligenceContent Understanding analyzers
Best forStandard, structured forms in high volume.Varied layouts, unstructured text, inferred fields.
InputDocuments only.Documents, images, audio and video.
Custom fieldsTrain a custom model with labeled samples.Describe fields in plain words; no labels to start.
Generative AINo.Yes.

Decision rule: standard form at scale, Document Intelligence. Varied content, generated fields or audio and video, Content Understanding.

[61][127]

Fernhill Travel receives free-form letters from partner hotels in many layouts. It needs each letter's hotel name and a generated one-line summary of what changed, without labeling samples first. What should you use?

Pick one answer.

[61][127]

Exam-style practice

Fernhill Travel wants forms with low-certainty totals sent to a person for review, and the reviewer must see where on the page each total came from. What should the analyzer return?

Pick one answer.

[60][122]

For each statement, select Yes if it is true. Statement: a Content Understanding analyzer that only needs the text and tables of scanned forms requires a field schema.

Pick one answer.

[95][122]

You build a custom analyzer for cruise brochures (PDF). Which value should base_analyzer_id have?

Pick one answer.

[95]

FlashcardsIndex cardsFlashcards ⚡

Card 1 of 18

[60][61][95][122][123]

Worth keeping

  1. Content Understanding turns content into Markdown plus fields with confidence and grounding.
  2. Standard document type: prebuilt analyzer. Your own fields: custom analyzer on a base analyzer.
  3. Field methods: extract copies, generate writes, classify picks from an enum.
  4. In code: create the client, begin_analyze or begin_analyze_binary, poller.result(), read fields.
  5. Standard forms at scale: Document Intelligence. Varied or multimodal content: Content Understanding.

On the job

Write each field description like an instruction to a new colleague: where the value sits and what it looks like. Start with a prebuilt analyzer when one exists. Set a confidence threshold, such as 0.8, below which a person checks the form. Keep the grounding visible in your review screen, so checking takes seconds.

[60][122]

Booking forms now fill themselves in. Then the helpline manager has 400 call recordings from last week. She wants to know why people called. Next lesson, Content Understanding takes on images, audio and video.

Leaderboard

Loading…

50 XP for each lesson you finish, 10 for each right answer. Names show only for learners who turn on Show me on leaderboards.

Embed this practice on your site

Free for classrooms, blogs and study groups. Paste this into any page that accepts HTML.

Report a copyright problem with this lesson

Sources for this lesson (10)

Each fact in the lesson is marked with the number of the page it comes from.

  1. [2]Microsoft Learn: Study guide for Exam AI-901: Microsoft Azure AI Fundamentals
  2. [60]Microsoft Learn: What is Azure Content Understanding in Foundry Tools?
  3. [61]Microsoft Learn: Choose the right Azure AI tool for document processing
  4. [95]Microsoft Learn: Azure Content Understanding in Foundry Tools prebuilt analyzers
  5. [122]Microsoft Learn: Azure Content Understanding in Foundry Tools - What is an analyzer? Configuration and reference
  6. [123]Microsoft Learn: Azure AI Content Understanding client library for Python
  7. [124]Microsoft Learn: Quickstart: Azure Content Understanding in Foundry Tools
  8. [125]Microsoft Learn: Create a custom analyzer with Azure Content Understanding in Foundry Tools
  9. [126]Microsoft Learn: Quickstart: Try Content Understanding Studio or Microsoft Foundry
  10. [127]Microsoft Learn: Which model should I choose? (Document Intelligence)