Azure数据工厂复制数据如果存在某个文件 [英] Azure-data-Factory Copy data If a certain file exists

查看:83
本文介绍了Azure数据工厂复制数据如果存在某个文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Blob容器中有很多文件.但是我只想在blob容器上存在某个文件(例如SRManifest.csv)的情况下运行存储过程.我在数据工厂上使用了获取元数据和IF条件.您能帮我提供动态脚本吗?我尝试了这个 @bool(startswith(activity('Get Metadata1').output.childitems.ItemName,'SRManifest.csv')).它不起作用.

I have many files in a blob container. However I wanted to run a Stored procedure only IF a certain file (e.g. SRManifest.csv) exists on the blob Container. I used Get metadata and IF Condition on Data Factory. Can you please help me with the dynamic script for this. I tried this @bool(startswith( activity('Get Metadata1').output.childitems.ItemName, 'SRManifest.csv')). It doesnt work.

然后我想,如果我使用 @greaterOREquals(activity('Get Metadata1').output.LastModified,adddays(utcnow(),-2))怎么办?但这会检查内部的最后修改2天的Bloob文件不存在.谢谢.

Then I thought, what if i used @greaterOREquals(activity('Get Metadata1').output.LastModified,adddays(utcnow(),-2))But this checks the last modified within 2 days of the Bloob not the file exist. Thank you.

请在下面的图表中查看

Please see below my diagram

推荐答案

我对您的要求有不同的理解.

I have understood your requirement differently I think.

我只想在blob容器上存在某个文件(例如SRManifest.csv)的情况下运行存储过程

1更改元数据活动以查找前哨文件(SRManifest.csv)

1 Change your metadata activity to look for existence of sentinel file (SRManifest.csv)

2进行IF活动,请使用以下条件:

2 Follow with an IF activity, use this condition:

3将您的sp置于IF活动的True部分

3 Put your sp in the True part of the IF activity

如果您还需要将文件列表传递给sp,则需要在IF-True活动中使用带有childitems的GetMetadata选项

If you also needed the file list passed to the sp then you'll need the GetMetadata with childitems option inside the IF-True activity

这篇关于Azure数据工厂复制数据如果存在某个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆