I wanted to comment on this post: I want to trigger Azure datafactory pipeline whenever there is a change in Azure SQL database
but I don’t have enough reputation…
The solution that Skin comes up with (SQL DB trigger events) looks exactly like what I’m after but I can’t find any further documentation on it – in fact the only references I’ve found say that this functionality doesn’t exist?
Can anyone point me to anything online – or a book – that could help?
Cheers
2
Answers
AFAIK, In ADF there are no such triggers for SQL changes. ADF supports only Schedule,Tumbling window and Storage event and custom event triggers.
But You can use the logic app triggers (item created and item modified) to triggers ADF pipeline.
For this we the SQL table should have an auto increment column.
Here is a demo I have built for item created trigger:
First search for SQL in logic app and click on item created trigger. Then create a connection with your details.
After that give your table details.
After trigger create Action for ADF pipeline run.
Make sure you publish your ADF pipeline to reflect its name in the above drop down. You can assign SQL columns to ADF pipeline parameter like above.
You can set the trigger for one every one minute or one hour as per your requirement. If any new item inserted into SQL table in that period of time it will trigger ADF pipeline.
I have inserted a new record like this
insert into practice values('Six');
Flow Suceeded:
My ADF pipeline:
Pipeline Triggered:
Pipeline successful and you can see variable value:
You can use another flow for item modified trigger as same above and trigger ADF pipeline from that as well.
with the new latest feature A new feature that allows invocation of any REST endpoints is now in public preview in Azure SQL databases
, I guess it is possible :
https://devblogs.microsoft.com/azure-sql/azure-sql-database-external-rest-endpoints-integration-public-preview/
Blog:
https://datasharkx.wordpress.com/2022/12/02/event-trigger-azure-data-factory-synapse-pipeline-via-azure-sql-database/