Build an Information Extraction App
30-second answer
A lightweight extraction app uses the azure-ai-contentunderstanding Python package. It creates a ContentUnderstandingClient with your Foundry endpoint and a credential, calls begin_analyze with an analyzer ID (such as prebuilt-invoice or your custom analyzer) and the file, waits on the poller, then reads result.contents[0].fields. Each field has a value and a confidence, so the app saves high-confidence values and sends low-confidence ones to human review.
Exam objective: 2.4.4 Build a lightweight application with information extraction capabilities by using Content Understanding. (Skills measured as of April 15, 2026)
Simulations
Feel it before you read it. No account needed, nothing leaves this page.
Install the SDK and point it at the <strong>resource endpoint</strong>.
👆 Click the glowing item in the portal to continue
Read the steps as text
- Install the SDK and point it at the resource endpoint.
- begin_analyze starts a long-running job; poller.result() waits for it. Each field has a value and a confidence.
- Run it. Low-confidence fields are flagged for a person.
🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.
🖱️ Drag to rotate · scroll or pinch to zoom
Extract from documents
Azure Content Understanding reads an invoice and returns fields you defined (vendor, date, total) with a confidence score for each, so low-confidence values can go to a person.
🤔 What happens if…
Read this tour as text
- Five workload lanes. Most AI apps fall into a few workloads: generative and agentic AI, text analysis, speech, computer vision and information extraction. Each lane here takes a different kind of input and turns it into something useful.
- Text analysis. A hotel review goes in. Azure Language returns the sentiment (positive, neutral, negative), key phrases, named entities (people, places, dates), PII and a short summary.
- Speech to text. Speech recognition turns spoken audio into text: live captions, call transcripts, voice commands. It can also translate speech into another language as you talk.
- Text to speech. Speech synthesis turns text into natural speech with a neural voice. SSML lets you control speed, pitch and pauses. Think audiobooks, voice assistants and accessibility readers.
- Computer vision. A photo goes in. Vision models return a caption, tags, objects with boxes, and any printed or handwritten text (OCR). A multimodal chat model can also answer questions about the picture.
- Image generation. Image-generation models work the other way round: a text prompt goes in and a brand-new image comes out. Guardrails block harmful requests, and generated images are marked with content credentials.
- Extract from documents. Azure Content Understanding reads an invoice and returns fields you defined (vendor, date, total) with a confidence score for each, so low-confidence values can go to a person.
- Extract from audio and video. The same service handles media: an audio call becomes a transcript with speakers and a summary; a video is split into segments with key frames, descriptions and chapters.
The same service reads photos, phone calls and videos. Classify car damage from a photo, summarise a support call, chapter a training video, then automate it in Python.
🎓 Education-only simulation. Your lab is saved in this browser, so you can leave and continue later.
😟 THE PROBLEM
Your finance team wants invoices processed without opening the portal.
😊 THE SOLUTION
A Python app that analyses each file and routes unsure fields to a person.
- Clicking through the portal✓ begin_analyze in code
- Long-running analysis✓ Poll for the result
- Low-confidence values✓ Send to human review
Start with a question
How do I get invoice totals into my own app instead of a portal screen?
Karthik has tested prebuilt-invoice in the Foundry portal and it reads his company’s invoices well. But the finance team doesn’t want to upload files to a portal. They want a script that picks up each new invoice, pulls out the fields and posts them to their system, and only bothers a person when something looks unsure.
That’s a small Python app with the azure-ai-contentunderstanding package: about 25 lines that call an analyzer and read the results.
Explain it like I’m 10
The technical explanation
Every Content Understanding app follows the same four steps, whatever the content type.
-
1 Connect
ContentUnderstandingClient with endpoint and credential.
-
2 Analyze
begin_analyze with an analyzer ID and the file.
-
3 Wait
poller.result() returns when the job is done.
-
4 Use
Read fields, check confidence, save or send to review.
What you need
- A Foundry resource with Content Understanding available and default model deployments set (analyzers call them).
- The resource endpoint (it looks like
https://<resource-name>.services.ai.azure.com/) and either a key or Microsoft Entra ID access. - An analyzer ID: a prebuilt one such as
prebuilt-invoice, or a custom analyzer you created in the portal.
The app
# extract_app.py
# pip install azure-ai-contentunderstanding
import os
from azure.ai.contentunderstanding import ContentUnderstandingClient
from azure.ai.contentunderstanding.models import AnalysisInput
from azure.core.credentials import AzureKeyCredential
client = ContentUnderstandingClient(
endpoint=os.environ["CONTENTUNDERSTANDING_ENDPOINT"],
credential=AzureKeyCredential(os.environ["CONTENTUNDERSTANDING_KEY"]),
)
invoice_url = "https://example.com/invoices/inv-1042.pdf" # your file's URL
# 1. Start the analysis (it runs asynchronously)
poller = client.begin_analyze(
analyzer_id="prebuilt-invoice",
inputs=[AnalysisInput(url=invoice_url)],
)
# 2. Wait for it to finish
result = poller.result()
fields = result.contents[0].fields
# 3. Read each field and route by confidence
THRESHOLD = 0.85
needs_review = []
for name, field in fields.items():
confidence = field.confidence or 0
print(f"{name}: {field.value} (confidence {confidence:.2f})")
if confidence < THRESHOLD:
needs_review.append(name)
# 4. Save or send to a person
if needs_review:
print("Send to review:", ", ".join(needs_review))
else:
print("All fields confident. Post to the finance system.")
Points worth knowing:
begin_means a long-running operation. You get a poller back straight away and call.result()to wait.result.contentsis a list. For one file you readcontents[0], which also has the Markdown of the document if you want the full text.- Each field has a
valueand aconfidence. Some fields (generated ones, for example) may not carry a confidence, which is why the code treats a missing score as 0. - To switch to keyless auth, replace
AzureKeyCredential(...)withDefaultAzureCredential()fromazure.identityafteraz login.
Same code, different content
Only the analyzer ID and the input change between content types:
| Content | Analyzer ID |
|---|---|
| Invoice | prebuilt-invoice |
| Receipt | prebuilt-receipt |
| Photo description | prebuilt-imageSearch |
| Call recording | prebuilt-audioSearch |
| Video | prebuilt-videoSearch |
| Your own fields | Your custom analyzer’s ID |
Architect level Making the review step useful
A review queue only helps if the reviewer can act fast. Store the grounding with each low-confidence field so your review screen can highlight the spot on the page or the timestamp in the recording. Set thresholds per field rather than one global number: a wrong invoice total costs more than a wrong supplier phone number. Track how often reviewers correct each field; if they almost never change a value, you can lower its threshold and send fewer documents to people.
Real-world business scenario
Contoso Logistics, Mumbai
- The problem
- Delivery receipts and supplier invoices arrived by email all day, and two people spent most of their week copying values into the accounts system.
- What they used
- A small Python job watches the inbox folder, runs prebuilt-invoice or prebuilt-receipt through ContentUnderstandingClient, posts fields above a 0.85 confidence threshold straight to the accounts system and sends the rest to a review page.
- Why that choice
- The SDK call is the same for every analyzer, so one script covers both document types, and confidence scores decide what needs a person.
- The result
- The two staff members now spend about an hour a day on flagged values instead of typing every document.
When to use it and when not to
✓ Use it when…
- Batch or event-driven jobs that pull fields from documents, images, audio or video into your own systems.
- Workflows that need automatic routing of low-confidence values to people.
- Reusing one script across content types by switching the analyzer ID.
✕ Think twice when…
- A one-off look at a single file. Testing in the Foundry portal is quicker.
- Real-time voice or chat experiences. Content Understanding analyzes files asynchronously.
- Posting high-value transactions without any human review of uncertain fields.
↔ Alternatives to consider
- **The Foundry portal** to test analyzers before writing code.
- **The REST API** directly if you're not using Python.
Test yourself with exercises
5 original practice questions in the AI-901 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.
Interview preparation
Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.
Beginner What are the main steps in a Python app that uses Content Understanding?
Model answer
Install azure-ai-contentunderstanding, create a ContentUnderstandingClient with the endpoint and a credential, call begin_analyze with the analyzer ID and the file, call result() on the poller, then read the fields from result.contents[0].fields.
Interviewer follows up
Why does the method start with begin?
You
Because analysis is a long-running operation. begin_analyze returns a poller straight away, and result() waits until the job finishes.
Intermediate How do you authenticate the ContentUnderstandingClient?
Model answer
Either with an AzureKeyCredential using the resource key, or with DefaultAzureCredential so it uses Microsoft Entra ID. For anything beyond a quick test I prefer Entra ID, so there's no key to leak.
Experienced developer How would you design the review step?
Model answer
I loop over the fields, compare each confidence to a threshold set per field, and if any important field is below it I put the whole document in a review queue with the low fields highlighted. I tune thresholds on a test set and log how often reviewers change values, so I can raise or lower them later.
Scenario Your extraction app works on invoices, and now the business wants it to handle call recordings too. What changes?
Model answer
Very little code. I'd switch the analyzer ID to prebuilt-audioSearch or a custom analyzer based on prebuilt-audio and point the input at the recording. The client, begin_analyze, the poller and the field-reading loop stay the same.
Quick revision
Key points
- Install azure-ai-contentunderstanding and create a ContentUnderstandingClient with the endpoint and a credential.
- begin_analyze takes an analyzer ID and inputs, and returns a poller.
- poller.result() returns the result; fields live in result.contents[0].fields.
- Each field has a value and a confidence between 0 and 1.
- Route values below your confidence threshold to a person.
Important terminology
- azure-ai-contentunderstanding
- The Python package for calling Azure Content Understanding analyzers.
- ContentUnderstandingClient
- The SDK client you create with the Foundry endpoint and a credential to run analyzers.
- begin_analyze
- The method that starts an analysis job and returns a poller, because analysis runs asynchronously.
- Poller
- An object that waits for a long-running job; poller.result() returns the analysis result when it's done.
- Confidence threshold
- The score you choose below which a value goes to a person instead of straight into your system.
Common mistakes
- Forgetting to call result() on the poller and trying to read fields from the poller itself.
- Hard-coding the key in the script. Use environment variables or DefaultAzureCredential.
Exam tips
- "Start analysis from Python" = begin_analyze on ContentUnderstandingClient.
- "Decide which values need a person" = compare each field's confidence to a threshold.
Five quick revision questions
-
1.Which Python package calls Content Understanding?Show
azure-ai-contentunderstanding.
-
2.Which client class do you create?Show
ContentUnderstandingClient.
-
3.Which method starts an analysis?Show
begin_analyze.
-
4.Where are the fields in the result?Show
result.contents[0].fields.
-
5.Which two properties do you read from a field?Show
value and confidence.
Official references
Finished this lesson? Tick it off. Your progress is saved in this browser.