Azure Event Grid Metadata Output change for Fivetran
I use Fivetran to lift data from on-prem servers to Azure Data Lake. After that happens, I use Azure Event Grid to send that event to a logic app. The logic app then triggers a Databricks job when the event is received. When I first started using Fivetran the metadata from the event included whether the file was FlushWithClose (Completed) or CreateFile (Incomplete) in the data.api section of the metadata output. I use these two states to indicate to logic apps whether or not to trigger a job. However, recently I realized that this piece of information is no longer being sent. There are still two events per file but there is now no way to tell them apart. Without this mechanism, for each file that is dropped into ADLS by Fivetran it will trigger two jobs, which I want to avoid.
I tried using Azure table storage to store each state of each event. For example if I have a file called my_file, azure will send the CreateFile state of this file and it will be stored in the table. when the FlushWithClose state is sent, the table is queried and the existing state will be returned and the databricks job will be triggered. This mechanism does not work as intended.