AI-102 Question 280
Select 3You are developing a client application that interacts with an Azure OpenAI language model to generate customer support responses. You need to ensure the application can send prompt data and receive responses securely and efficiently. Which steps should you perform to consume the language model from your application?
- A
Obtain an API key from the Azure OpenAI resource and include it in the Authorization header of your HTTP requests.
- B
Deploy the model to an Azure Kubernetes Service (AKS) cluster to enable secure communication.
- C
Use the Azure OpenAI REST API's endpoint URL to send POST requests with prompt data in JSON format.
- D
Enable the Azure OpenAI resource's Managed Identity to bypass the need for an API key.
- E
Validate and sanitize input data before sending it to the language model to prevent injection attacks.
Show answer and explanation
Correct answers: A, C, E
Explanation
To consume a language model from a client application, you must authenticate using an API key, send properly formatted POST requests to the Azure OpenAI REST API endpoint, and ensure input data is sanitized to prevent security risks. Deploying the model to AKS or relying on Managed Identity is unnecessary for using the Azure OpenAI service.
- A. Correct.
Correct. An API key is required to authenticate requests to the Azure OpenAI service. It must be included in the Authorization header of your HTTP requests.
- B. Incorrect.
Incorrect. Deploying the model to an AKS cluster is not required for consuming the Azure OpenAI language model. The model is hosted and managed by Azure automatically.
- C. Correct.
Correct. The Azure OpenAI REST API allows you to interact with the language model by sending POST requests to the endpoint URL with the necessary prompt data in JSON format.
- D. Incorrect.
Incorrect. While Managed Identity is a feature in Azure, it is not currently used to authenticate requests to the Azure OpenAI service. Authentication requires an API key.
- E. Correct.
Correct. Validating and sanitizing input data is a best practice to prevent security vulnerabilities, such as injection attacks, when interacting with any API.