Courseiva
Implement generative AI solutionshardMultiple ChoiceObjective-mapped

AI-102 Implement generative AI solutions Practice Question

You are building a generative AI application that uses Azure OpenAI Service. The application must access data from an Azure SQL database to answer user questions. You need to implement a solution that retrieves the most relevant data without exposing the database schema to the model. Which approach should you use?

⚠ Common exam trap

Candidates often assume the model can safely generate SQL queries (Option A) because it seems efficient, but they overlook the security and schema exposure risks, as well as the fact that Azure OpenAI On Your Data is the designed pattern for this exact use case.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Use a middle-tier service to query the database, then pass results to the model via Azure OpenAI On Your Data

It uses a middle-tier service to query the Azure SQL database and then passes only the relevant results to the Azure OpenAI model via the 'On Your Data' feature. This approach ensures the model never sees the database schema, protecting sensitive structural details while still providing the necessary context for answering user questions. It also allows the middle-tier to handle authentication, query optimization, and data filtering securely.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Configure the model to generate SQL queries and execute them against the database

    Why it's wrong here

    The model should not execute SQL directly due to security and reliability concerns.

  • Use a middle-tier service to query the database, then pass results to the model via Azure OpenAI On Your Data

    Why this is correct

    This isolates the database and provides relevant context to the model.

  • Embed the entire database schema in the system prompt

    Why it's wrong here

    Exposing schema is a security risk and inefficient.

  • Fine-tune the model with historical query results from the database

    Why it's wrong here

    Fine-tuning does not enable real-time data retrieval.

About these practice questions

One of 945 original AI-102 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This AI-102 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AI-102 exam.