Integrate an on-premises SQL Server with Azure AI Search

Paritosh Raval 5 Reputation points
2024-01-30T10:01:09.2266667+00:00

I am attempting to establish a connection between an on-premises SQL Server and Azure AI Search. However, when trying to import data using the provided connection string:


Server=tcp:sql.bsite.net,1433;Database=mydbname;User ID=myuserid;Password=mypassword;Trusted_Connection=False;Encrypt=True;Timeout=120;



BadRequest: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - The wait operation timed out.). My inquiry is whether there might be any missing elements in my connection string. Alternatively, does Azure AI Search not support a direct connection of this nature, requiring the creation of a SQL Server on Azure instead?

Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
1,227 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Ramr-msft 17,821 Reputation points
    2024-01-30T12:49:17.06+00:00

    Thanks for the question, This sample demonstrates a few approaches for creating ChatGPT-like experiences over your own data using the Retrieval Augmented Generation pattern. It uses Azure OpenAI Service to access the GPT model - gpt-4(8k tokens), Azure Cognitive Search for data indexing and retrieval of unstructured content (pdf files) and SQL Server for retrieving data from SQL server tables. The AOAI on your data with the RAG pattern doesn't restrict to structured or unstructured data. Just that Azure Cognitive Search is a search engine which is expected to support rich indexing and query syntax over the heterogeneous data sources behind it. Plus with the embeddings model, ACS supports vector search and Az SQL probably doesn't. So I guess if you want to use ACS but just your own SQL db, you just need to do SQL queries instead of ACS search and then put the query results into the final prompt. there is an Azure SQL indexer that can bring SQL db in Azure VM to ACS.

    1 person found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.