ADF Copy 只有当一个新的 CSV 文件被放置在源中并复制到 Container 时

ADF Copy only when a new CSV file is placed in the source and copy to the Container

我想将文件从源文件复制到目标容器,但前提是源文件是新的 (最新文件放在源中)。我不确定如何进行此操作,也不确定检查大于目标的源文件的语法。我是否应该使用两个获取元数据 activity 来检查源和目标最后修改日期并使用 if 条件。我尝试了几种方法,但没有用。 任何帮助都会派上用场

我用于条件的语法给我错误

@if(greaterOrEquals(ticks(activity('Get Metadata_File').output.lastModified),activity('Get Metadata_File2')),True,False)

错误信息

函数 'greaterOrEquals' 要求其所有参数都是整数或小数。发现无效的参数类型:'Object'

您可以尝试 ADF 提供的管道模板之一。

Use this template to copy new and changed files only by using LastModifiedDate. This template first selects the new and changed files only by their attributes "LastModifiedDate", and then copies them from the data source store to the data destination store. You can also go to "Copy Data Tool" to get the pipeline for the same scenario with more connectors.

View documentation

或...

您可以使用 存储事件触发器 来触发带有副本 activity 的管道,以便在每个新文件写入存储时进行复制。

按照此处的详细示例:Create a trigger that runs a pipeline in response to a storage event