Your Azure data factory sink might not work as expected, have you not considered these settings already

   




ADF is a very convinient way of moving data from external system to Azure SQL storages (Azure SQL, Azure MySQL, Azure cosmos DB, Cassandra: not to mention blob, table and file systems), without writing any code. In fact dataflows are so convinent ways of handling data, that it definitely does have an upperhand as compared to Azure Synapses, where you need to write a lot of staff in Python on JuPyter Notebook to instigate the cleaning and transformation processes.

However your ADF dataflows could fail very weirdly, if you have not considered these options. These happen typically when any of your Source/sink involves an Azure SQL connection:

A. Missing property error:

Your piepline gave a nasty error as: 

What?!!! Wait -- I have validated the pipeline and published everything without any errors. Even then, why on earth, did it happen?
Solution: While creating the sink/source Linked Service, you need to select 'Legacy' instead of 'Recommended' in Version parameter:


B. Result has Zero output columns:
Your pipeline got this error, while running:

Now, there are several reasons possible.
I. Allow schema drift, while defining sink/source: You need to set the schema drift, while defining the source/sink settings:

 
II. Be mindful of what are you mapping: yes, you need to remember there is a difference between 'Currency' and 'currency'. While T-SQL syntanxes won;t mind this, but for ADF it would be considered as an unknown field. For example, the below example shows a currency field, which is a Dereived column from a previous step, but needs to be 'Currency' column of AzureSQL:


 C.Allowing Update/Upsert on AzureSQL table: if you have selected to include 'Allow Update' /Allow upsert on your Sink, you need to add 'An alter row transformation' logic:



This guy is so cool, that it just creates an intermediate block before your Sink module, that takes care of the 'Update' logic, without your needing to write anything:


Click on this new block and go to the settings to append the Alteration condition (the below figure shows an 'upsert if' and 'delete if' expression conditions, which say to update/insert if the Key column, in our case CustomerNo, is not empty) accordingly:




D. The key column is not specified on Sink: this is easy. You come to Sink >> Settings >> Check if the key column is still there or  not. If not re-select the key column and validate again. The error will go. 




Comments

Popular posts from this blog

X++ : mistakes which developers commit the most

Make your menu items visible on main menu, conditionally,, using this cool feature of D365FO

Speed up your execution performance by using SysGlobalCaches