Skip to content
Microsoft Azure AI Fundamentals (AI-901) Exam Prep

Lesson 4 of 5 · 16 min

x
4/5

Domain 2: Implement AI Solutions by Using Microsoft Foundry (Part 2 of 3)

This lesson covers 5 exam topics: Building a Client App for an Agent, Building a Text Analysis App, Responding to Spoken Prompts, Building a Speech App with Azure Speech, Interpreting Images with Multimodal Models. Each topic has a short video, then the notes: key facts, exam traps and what to check in the official docs.

1. Building a Client App for an Agent

Video lesson: AI-901 16/25: Building a Client App for an Agent

Central question: How does an application talk to a Foundry agent?

Verified Python pattern

1project = AIProjectClient(endpoint=PROJECT_ENDPOINT, credential=DefaultAzureCredential())2openai = project.get_openai_client(agent_name=AGENT_NAME)   # client bound to the agent3conversation = openai.conversations.create()                  # multi-turn history4r = openai.responses.create(conversation=conversation.id, input="What is the size of France?")5print(r.output_text)6r = openai.responses.create(conversation=conversation.id, input="And its capital?")  # follow-up keeps context

Agents can also be defined in code: project.agents.create_version(agent_name=..., definition=PromptAgentDefinition(model=..., instructions=...)) (verified), useful for version control and CI/CD.

Key ideas

ConceptPurpose
get_openai_client(agent_name=...)Calls go to the named agent
ConversationKeeps history across turns
responses.createSends a message, returns the agent's reply

Exam traps

  • New conversation each turn, losing context.
  • Calling the model directly when the agent's tools and instructions are needed.
  • Recreating the agent on every request. Create once; reuse.

2. Building a Text Analysis App

Video lesson: AI-901 17/25: Building a Text Analysis App

Central question: How do you add text analysis to an application?

Two ways (verified services; choice is design guidance)

ApproachHowFits
Azure LanguageClient library (TextAnalyticsClient), REST, or Foundry playground; features such as PII, language detection, NER, sentimentConsistent, typed results; built-in PII and entity categories
Generative modelPrompt a deployed model: "Return sentiment and key topics as JSON"Flexible, custom categories, summaries

Azure Language features are also available as tools via the Azure Language MCP server for agents (verified). Sentiment, key phrases and summarization are legacy Azure Language capabilities; PII, language detection and NER are core (verified).

App flow (general background)

Input text → call the service/model → parse results (labels, scores, entities) → act (route ticket, redact PII, chart sentiment).

Exam traps

  • Generative model for strict PII redaction where a dedicated PII feature is more consistent.
  • Ignoring confidence scores.
  • No output format in the prompt, making parsing fragile.

3. Responding to Spoken Prompts

Video lesson: AI-901 18/25: Responding to Spoken Prompts

Central question: How does an app answer a user who speaks?

Options

OptionHow
Audio-capable multimodal modelSend audio as input; get text and/or audio out (e.g. gpt-4o-audio-preview, gpt-4o-mini-audio-preview)
gpt-realtimeReal-time interactive voice
Voice Live APIFully managed low-latency speech-to-speech for voice agents; combines recognition, generative AI and synthesis
Voice-based prompt agentAgent configured with model, instructions, audio settings and tools, connected through Voice Live
PipelineSpeech to text → chat model → text to speech (Azure Speech)

Audio model modality combinations include audio in → text out (transcription) and audio in → text + audio out (spoken replies) (verified).

Exam traps

  • Building a three-step pipeline when one audio-capable model or Voice Live does it with less latency.
  • Text-only chat model for audio input.
  • Ignoring latency for live conversations; use real-time options.

4. Building a Speech App with Azure Speech

Video lesson: AI-901 19/25: Building a Speech App with Azure Speech

Central question: What code recognizes and synthesizes speech?

Verified Python patterns (azure-cognitiveservices-speech)

1import azure.cognitiveservices.speech as speechsdk2speech_config = speechsdk.SpeechConfig(subscription=KEY, endpoint=ENDPOINT)3 4# Speech to text5audio_config = speechsdk.audio.AudioConfig(use_default_microphone=True)6recognizer = speechsdk.SpeechRecognizer(speech_config=speech_config, audio_config=audio_config)7result = recognizer.recognize_once_async().get()8print(result.text)9 10# Text to speech11speech_config.speech_synthesis_voice_name = "en-US-Ava:DragonHDLatestNeural"12synth = speechsdk.SpeechSynthesizer(speech_config=speech_config)13synth.speak_text_async("Your order has shipped.").get()
ObjectRole
SpeechConfigCredentials, endpoint, voice and language settings
AudioConfigMicrophone, speaker or file
SpeechRecognizerSpeech → text (recognize_once_async for one utterance)
SpeechSynthesizerText → speech (speak_text_async, or SSML)

Exam traps

  • Recognizer for synthesis (or vice versa).
  • recognize_once for long recordings. Use continuous or batch transcription.
  • No voice name, getting a default voice.

5. Interpreting Images with Multimodal Models

Video lesson: AI-901 20/25: Interpreting Images with Multimodal Models

Central question: How do you ask a model about an image?

How

  • Deploy a vision-enabled chat model and include the image in the message alongside text.
  • Images are passed as an image URL or base64 data URL content part ("type": "image_url"), together with a text part asking the question.
  • Set max tokens for the response length.
  • Content filtering applies to vision requests.

Typical uses (general background)

Describe a photo; read text in an image; compare two product photos; analyze a damage photo for an insurance claim; interpret a chart.

Good practice (design guidance)

  • Ask specific questions and request structured output.
  • Combine with grounding (e.g. product catalog) to avoid guesses.
  • Review outputs for high-stakes decisions.

Exam traps

  • Text-only model with an image. It must be vision-enabled.
  • Expecting exact bounding boxes from a chat model; use detection-specific tools for that.
  • No question in the prompt, only an image.

References

  1. AI-901 study guide — checked Oct 21, 2026
  2. Quickstart: prompt agent — checked Oct 21, 2026
  3. Azure Language overview — checked Oct 21, 2026
  4. Sentiment quickstart — checked Oct 21, 2026
  5. Audio generation quickstart — checked Oct 21, 2026
  6. Voice Live — checked Oct 21, 2026
  7. Agents in Foundry — checked Oct 21, 2026
  8. Speech to text quickstart — checked Oct 21, 2026
  9. Text to speech quickstart — checked Oct 21, 2026
  10. What is Azure Speech — checked Oct 21, 2026
  11. Use vision-enabled chat models — checked Oct 21, 2026

Check your understanding

  • How does a follow-up keep context?Show answer

    Answer

    Same conversation ID.
  • Redact names and phone numbers from chats?Show answer

    Answer

    Azure Language PII detection.
  • Model accepting spoken questions and replying in speech?Show answer

    Answer

    An audio-capable model (e.g. gpt-4o-audio-preview).
  • Object that turns text into audio?Show answer

    Answer

    SpeechSynthesizer.
  • How is an image included in a chat request?Show answer

    Answer

    As an image_url content part (URL or base64).
Previous

Progress is saved in this browser.

Next Lesson