Pre-copy script in Copy Activity is not available in Azure Data Factory when Sink is ADX Azure Data Explorer


Data is ingested using Copy Activity of Azure Data Factory into Azure Data Explorer table.

Need to clear/truncate the data from ADX table before load.

But Pre-copy script feature not available when ADX is used as sink in copy Activity.

Azure Data Explorer
Azure Data Explorer
An Azure data analytics service for real-time analysis on large volumes of data streaming from sources including applications, websites, and internet of things devices.
431 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
8,533 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KranthiPakala-MSFT 45,982 Reputation points Microsoft Employee

    @Anonymous Thanks for using Microsoft Q&A forum and posting your query.

    Unlike other database connectors the Pre-copy script feature is not available when ADX is used as a sink in Copy Activity. Hence you will have to take an alternative approach to clear or truncate data from the ADX table before loading new data.

    Possible workaround: One possible approach is to use the lookup activity before your copy activity and execute a query that clears or truncates the table data (Note: Please ensure that your query returns a valid json response to your lookup activity).

    Here's an example query that clears a table: .clear table data command

    Please refer to this document where there is an sample on how to execute a Kusto query using lookup activity: Use Azure Data Factory command activity to run Azure Data Explorer management commands

    In case if you have any feedback for product team to implement pre & post script feature for ADX connector, please feel free to share your feedback in IDEAS forum: Please do share the feedback link once it is submitted so that other users with similar feedback can up-vote and comment on your feature request to help increase the priority of the request.

    I hope this info helps!

    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments