AI-102 Plan and manage an Azure AI solution Practice Question
Exhibit
Refer to the exhibit.
az cognitiveservices account list -g rg-ai --query "[?kind=='OpenAI'].{Name:name, Endpoint:properties.endpoint, Location:location}" -o table
Name Endpoint Location
chatgpt https://chatgpt.openai.azure.com/ eastus
gpt4 https://gpt4.openai.azure.com/ westeuropeYou executed the Azure CLI command to list Azure OpenAI resources. You need to programmatically access the endpoint of the resource named 'gpt4' in a script. What is the most reliable way to extract the endpoint?
⚠ Common exam trap
Many candidates default to parsing the default table output (Option B) because it looks human-readable, but the exam tests understanding that structured JSON queries are the reliable, production-grade method for programmatic access.
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 az cognitiveservices account show with --query to filter by name
`az cognitiveservices account show` with the `--query` parameter allows you to retrieve the specific endpoint property for a named resource using JMESPath filtering. This approach is reliable, scriptable, and avoids parsing unstructured output, which is error-prone. The Azure CLI returns structured JSON, and `--query` extracts the exact value without manual string manipulation.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use Azure PowerShell Get-AzCognitiveServicesAccount cmdlet
Why it's wrong here
PowerShell is an alternative but not the most reliable for this specific scenario.
- ✗
Parse the table output using string manipulation
Why it's wrong here
Parsing table output is less reliable than using structured queries.
- ✓
Use az cognitiveservices account show with --query to filter by name
Why this is correct
Using --query with JMESPath provides a reliable way to extract specific values.
- ✗
Deploy a new Azure OpenAI resource with a known endpoint
Why it's wrong here
Deploying a new resource is not necessary.
Go deeper
Related to this question
About these practice questions
This AI-102 question is part of Courseiva's 945-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
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.