AI-900 practice question 8 of 35

Which two tools can you use to call the Azure OpenAI service? Each correct answer presents a complete solution. NOTE: Each correct answer is worth one point.

Full set: 316 questions

Domain Describe fundamental principles of machine learning on Azure

Answer options
A: Azure Command-Line Interface (CLI)
B: Azure REST API Correct answer
C: Azure SDK for Python Correct answer
D: Azure SDK for JavaScript
Correct Answer:
B. Azure REST API; C. Azure SDK for Python
Explanation

The Azure OpenAI service's capabilities can be integrated into applications through two primary methods. The first is by making direct calls to its Azure REST API, which is a language-agnostic, standard web-based interface for sending prompts and receiving completions. The second method is by using the language-specific Azure SDKs, such as the Azure SDK for Python. The SDK provides a convenient wrapper around the REST API, simplifying authentication and interaction with the service for developers working within a specific programming environment like Python, which is prevalent in AI development. These two methods represent the foundational and the most common developer-focused approaches for using the service.

Why Incorrect

A. Azure Command-Line Interface (CLI): While the az openai CLI extension can call the service, the CLI is primarily a tool for resource management, automation, and quick tests, not a primary method for building integrated applications.
D. Azure SDK for JavaScript: This is also a correct way to call the service. However, the question asks for only two answers. The Python SDK is more prominently featured in AI-900 learning materials and is the dominant language in the AI/ML field, making it a more representative choice alongside the fundamental REST API. ---

References

1. Microsoft Learn (Official Vendor Documentation): "Quickstart: Get started generating text using Azure OpenAI Service". This document provides side-by-side examples of how to call the service.

Reference for B (Azure REST API): The "REST API" tab explicitly details the HTTP request structure

headers

and body required to call the completions endpoint.

Reference for C (Azure SDK for Python): The "Python" tab provides a complete code sample demonstrating the use of the openai library (the official SDK) to connect to and call the Azure OpenAI service.

2. Microsoft Learn (Official Vendor Documentation): "Azure OpenAI Service REST API reference". This document serves as the official specification for all available REST API endpoints for the Azure OpenAI service

confirming it as a primary method of interaction.

Reference for B (Azure REST API): See the "Completions - Create" section for the API definition.

3. Microsoft Learn (Official Vendor Documentation): "How to use the Azure OpenAI completion models". This guide provides conceptual information and links to quickstarts.

Reference for B & C: In the "Calling the API" section

it states

"To make a call to the completions API you'll need your endpoint and a key. You can get this information from the Keys & Endpoint section of your resource in the Azure portal. You can interact with the models in two ways: the REST API

or the Python SDK." This directly supports both chosen answers as the main interaction methods.

Scroll to Top