0
votes

I have an empty search service created in my Azure portal. What I need to do is create an index, fill it with data from a SQL Server hosted on an Azure VM from one table (so not an Azure database itself, but a database hosted on Azure VM), create an indexer so this data is pulled into Azure when changes happen.

I'm not understanding what the exact order should be for creating these items (Index, Indexer, DataSource) and how to tie the Indexer to the Index. I'll be making API calls since I can't seem to use the Azure portal for importing data from a SQL Server hosted on an Azure VM. Also, direction on how to make these API calls would be great as well.

3
I was about to write an answer but 2 guys beat me to it :). If you're looking for a tool to do all this instead of coding the API or using the SDK, do take a look at Cerulean from Cerebrata - cerebrata.com/products/cerulean/features/azure-search (Disclosure: I am part of Cerebrata team).Gaurav Mantri
Thanks, but it looks like that tool doesn't support SQL Server on an Azure VM which is different than SQL database within Azure?Andy
I have not tried that part but as long as Azure Search can reach your SQL Server, I think this tool will work. All it is doing is helping you create indexes, data sources and indexers. Once they are created properly, Azure Search does its magic :).Gaurav Mantri

3 Answers

3
votes

Generally speaking, the logical ordering would be Index > DataSource > Indexer. However, you could potentially flip Index and DataSource.

An Index is where your search data is stored and is the entity against which you'll perform queries.

DataSource describes the location of data you want to pull into an Index and would include a SQL query to pull out rows that should be included in your Index.

The Indexer is the glue between these two things as it schedules a regular pull between an Index and DataSource.

This is the reason that DataSource and Index are interchangeable. A DataSource has no concept (and no need to know) about which Index it's data might end up in. You could even have a DataSource used against multiple Indices if you wanted. They would just each need their own Indexer that links the DataSource to each Index on a particular schedule.

0
votes

Please take a look at these articles:

  1. Connecting Azure SQL Database to Azure Search using indexers

  2. Configure a connection from an Azure Search indexer to SQL Server on an Azure VM

You can configure data sources and indexers directly in Azure portal by using the Import Data wizard, but it's still good to go over the more in-depth articles linked above.