試験AI-103 トピック1 問題39 スレッド
Microsoft AI-103のリアル試験問題集
問題 #: 39
トピック #: 1
問題 #: 39
トピック #: 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.

おすすめの解答:

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.
丰原** 2026-09-14 09:34:14
コメント
他人の解答コメントを賛成するのも、その解答に一票を入れることになります。したがって、すでに同じ意見の投票コメントが存在する場合、新規コメントをする代わりに賛成することもできます。
コメントを通報する
コメント中
今すぐ 新規登録 / ログイン (無料です)。