Course menuAI-901

Exams / AI-901 / Chat client apps with the Foundry SDK / Question 1

AI-901 practice question: Chat client apps with the Foundry SDK (1 of 4)

Implement AI solutions by using Microsoft Foundry A free question from our original AI-901 practice exam. Try it, then open the answer to see why each option is right or wrong.

Last verified against current Microsoft Learn ·How we write our questions

A university computer science department is writing a Python script that connects to its Foundry project and sends prompts to a chat model. Each developer must sign in with their own Microsoft Entra identity.

Which class connects the script to the Foundry project?

Choose one answer.

  1. A. TextAnalyticsClient from the azure.ai.textanalytics package, which connects to a Language resource
  2. B. DefaultAzureCredential from the azure.identity package, which signs in with Microsoft Entra ID
  3. C. AIProjectClient from the azure.ai.projects package, given the project endpoint and a credential
  4. D. AzureKeyCredential from the azure.core package, which wraps a resource key
Show the answer and explanation

Answer: C

  • A. Wrong: TextAnalyticsClient connects to an Azure Language resource for text analysis. It is not the client for a Foundry project, so it cannot send chat prompts to project deployments.
  • B. Wrong: DefaultAzureCredential provides Microsoft Entra sign-in, and the script passes it to a client. On its own it does not connect the script to any Foundry project.
  • C. Right: Correct. AIProjectClient connects to a Foundry project through its endpoint and a credential such as DefaultAzureCredential. The project client then gives access to model deployments and agents. Learn more: Get started with code in Microsoft Foundry (opens in a new tab)
  • D. Wrong: AzureKeyCredential wraps a resource key for authentication. It only supplies a key, so it cannot connect the script to a project by itself.

Explanation

AIProjectClient is the class that connects code to a Foundry project, using the project endpoint and a credential. DefaultAzureCredential supplies the Entra sign-in but connects to nothing. The other two classes serve other tasks.

Study

Keep practicing

Answer questions with a score at the end, or practice just this topic with the explanation after each one. No sign-up needed.

Want more on Chat client apps with the Foundry SDK? The 5 full-length practice sets have 20 more Chat client apps with the Foundry SDK questions, 225 in all, none of them in the free exam. One payment of $9.99 $6.99, no subscription. Get the practice sets

Every exam starts with free questions. No account needed.