0
votes

I want to sync any DML operations on Azure SQL DB to azure search index immediately.

I have gone through this question. How does Auto-indexing/sync of Azure SQL DB with Azure Search Works?

No answer in this question. This was posted almost 5 yrs back. With integrated change policy in place do we have auto sync feature by any means now.

Function app does not have a SQL trigger event attached.

I don't want to do a while true loop or any timer or call indexer when data gets update. Please suggest if there are any other best approach or any build feature.

2

2 Answers

1
votes

Azure Functions don't have a SQL trigger but Logic Apps do: https://docs.microsoft.com/en-us/azure/connectors/connectors-create-api-sqlazure Logic Apps can also trigger functions and custom APIs, so you should be able to trigger an indexing operation from a SQL operation this way. Do keep in mind however that the indexing process itself may be delayed or take time once triggered so your index may not immediately reflect the changes, depending on payload.

1
votes

There are two ways you can integrate Azure SQL data with Azure Search.

Built-in indexer. You have the built-in index support for Azure SQL. It supports incremental updating of the index, but with a limited refresh ratio. Currently, you can run incremental indexing every 5 minutes at the most. See Connect to and index Azure SQL content using an Azure Cognitive Search indexer

Push API. To support immediate updates, you have to push data via the Push API. In this case you only create the index, not the indexer. Your code that pushes content to Azure SQL is responsible for pushing content to Azure Search. Check out this example Tutorial: Optimize indexing with the push API