Exam AI-103 Topic 1 Question 38 Discussion
Actual exam question for Microsoft's AI-103 exam
Question #: 38
Topic #: 1
Question #: 38
Topic #: 1
You have a Python application named App1 that integrates with a Microsoft Foundry project named Project1.
You need to ensure that App1 meets the following requirements:
* Authenticates by using a Microsoft Entra managed identity
* Sends prompts to a deployed model by using the Azure OpenAI Responses API How should you complete the Python code? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.

You need to ensure that App1 meets the following requirements:
* Authenticates by using a Microsoft Entra managed identity
* Sends prompts to a deployed model by using the Azure OpenAI Responses API How should you complete the Python code? To answer, select the appropriate options in the answer area.
NOTE: Each correct selection is worth one point.

Suggested Answer:

Explanation:
credential = DefaultAzureCredential
response = openai_client.responses.create
The correct authentication class is DefaultAzureCredential because the requirement is Microsoft Entra-based authentication, and this credential supports managed identity in hosted Azure environments. The Microsoft Foundry quickstart for Python shows the project client being created with AIProjectClient (endpoint=PROJECT_ENDPOINT, credential=DefaultAzureCredential()), which enables the Foundry SDK to authenticate without using API keys or embedded secrets. The same guidance shows creating an OpenAI- compatible client from the project by calling project.get_openai_client().
The correct Responses API method is create because the application must send a new prompt to the deployed model and receive generated output. Microsoft's Foundry quickstart demonstrates the exact pattern: response
= openai.responses.create(model= " gpt-5-mini " , input= " ... " ), followed by reading response.output_text.
The retrieve operation is used to fetch an existing response, not submit a new inference request, and compact is not the correct method for generating a model response. AzureKeyCredential would violate the Microsoft Entra managed identity requirement, while ClientSecretCredential uses an application secret rather than managed identity. Reference topics: Microsoft Foundry SDK, AIProjectClient, Microsoft Entra authentication, DefaultAzureCredential, and Azure OpenAI Responses API.
by Leonard at Jun 30, 2026, 08:37 AM
0
0
0
10
Comments
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
Report Comment
Commenting
You can sign-up / login (it's free).