Learn how to create and configure an Azure SQL data source for Azure AI Search. This detailed guide simplifies key concepts, helping you ace the Microsoft Azure AI-102 certification exam.
Table of Contents
Question
You are a developer for Xerigon Corporation. You create the following JSON script to create a data source for the dbo.mytable table in an Azure SQL database that is used by the Azure AI Search service.
A https://<your-search-service>.search.windows.net/datasources?api-version=2024-07-01 { B : "application/json", "api-key": "<your-admin-key>" } { "name": "myazuresqldatasource", "description": "A data source for Azure SQL Database.", "type": "azuresql", "credentials": { "connectionString": "Server=tcp:<your-server>.database.windows.net,1433;Database=<your-database>;User ID=<your-username>;Password=<your-password>;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;" }, C : { "name": ""dbo.mytable"" } }
After the running the script, you receive the following response:
201 Created
Drag the missing code pieces to the appropriate letter.
Code:
- GET
- POST
- ‘Content-Type’
- ‘object’
- ‘container’
- ‘table’
Answer
A. POST
B. ‘Content-Type’
C. ‘container’
Explanation
The following JSON script creates a data source for the dbo.mytable table in an Azure SQL database that is used by the Azure AI Search service.
POST https://<your-search-service>.search.windows.net/datasources?api-version=2024-07-01 { "Content-Type": "application/json", "api-key": "<your-admin-key>" } { "name": "myazuresqldatasource", "description": "A data source for Azure SQL Database.", "type": "azuresql", "credentials": { "connectionString": "Server=tcp:<your-server>.database.windows.net,1433;Database=<your-database>;User ID=<your-username>;Password=<your-password>;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;" }, "container": { "name": "dbo.mytable" } }
To create a data source for the Azure AI Search service, the JSON script needs URI parameters, request headers, and a request body.
The URI parameters can use either a POST or a PUT on the request. You would not use a GET in the request because this code is retrieving, not creating.
The request header section of the JSON script consists of the Content-Type and api-key. The Content-Type field is required. The field named object is not valid in the Request Header section but “object“ can be used as the value of a parameter.
The request body section contains the object name, description, credentials, and container that describes the type of object – table, view, collection, blob, etc. – that you want to create. You would use “container” as the name of the field to create the object. In this scenario, you want to create a data source for the dbo.mytable table in the Azure Database. You cannot use “table” as the field name since container is the only valid name.
If the request in the JSON script was successful, then the response of 201 created indicates that the data source was created.
Microsoft Azure AI Engineer Associate AI-102 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the Microsoft Azure AI Engineer Associate AI-102 exam and earn Microsoft Azure AI Engineer Associate AI-102 certification.