Get Your CertMicrosoft Applied Skills: Develop a Generative AI Chat App Using the Microsoft Foundry SDKPlayCompete
‹ All Microsoft Applied Skills: Develop a Generative AI Chat App Using the Microsoft Foundry SDK questions

Microsoft Foundry Generative AI Chat App Practice Question 6: Initialize Project Client

Microsoft Applied Skills: Develop a Generative AI Chat App Using the Microsoft Foundry SDK · Test 1 · question 6 of 10

Create a chat app by using the Microsoft Foundry SDKeasy

Your Python chat app needs to send its first prompt to a gpt-5-mini deployment in a Microsoft Foundry project. You have already run az login. Which sequence correctly initializes the client and issues the call?

Select one answer
Show answer and explanation

Answer:

  • B. Construct AIProjectClient with the project endpoint and DefaultAzureCredential(), call get_openai_client(), then call responses.create()

The quickstart pattern is exactly this: create AIProjectClient(endpoint=FOUNDRY_PROJECT_ENDPOINT, credential=DefaultAzureCredential()), then openai = project.get_openai_client(), then openai.responses.create(model="gpt-5-mini", input=...). The SDK exposes two client types: the project client for Foundry-native operations and the OpenAI-compatible client, obtained from it, for the Responses API. az login is what makes DefaultAzureCredential resolve to a usable token.

- A is wrong because https://ai.azure.com is the portal web address, not an API endpoint. The project endpoint has the form https://<resource-name>.services.ai.azure.com/api/projects/<project-name>. - C is wrong because CognitiveServicesManagementClient is the management-plane client used to create, list, and delete Foundry resources and projects. It has no inference surface at all. - D is wrong because https://<resource-name>.openai.azure.com is the OpenAI SDK endpoint, used when you want maximum OpenAI compatibility. AIProjectClient expects the project endpoint, and the samples authenticate with Entra ID rather than a key.

Reference: Quickstart: Get started with Microsoft Foundry SDK

Practice Test 1 ›