[英]Requiremet of Error logging mail(mail should contain all the missing file details). in the ADF flow
the reqirement is simple, i have a folder having 4 txt files(1.txt,2.txt,3.txt,4.txt).要求很简单,我有一个包含 4 个 txt 文件(1.txt、2.txt、3.txt、4.txt)的文件夹。 the Flow is controlled by a parameter called all or some which is of string type.
Flow 由一个名为all 或 some的字符串类型的参数控制。
If i select all in the parameter, all 4 file should be processed.如果 i select 全部在参数中,则应处理所有 4 个文件。 the requirement starts here >>
要求从这里开始 >>
IF any file is missing from the folder(for ex 2.txt and 3.txt is not present and i selected ALL in the parameter), i need a mail saying file is 2.txt and 3.txt is missing.如果文件夹中缺少任何文件(例如2.txt 和 3.txt不存在并且我在参数中选择了ALL ),我需要一封邮件说文件是 2.txt 和 3.txt 丢失。
If i select some in the parameter, for ex 1.txt and 4.txt and if any of the file is missing 1.txt and 4.txt is missing(for example 1.txt is missing), i need a mail with the missing file name(ie 1.txt in our case).如果我 select 参数中的一些,例如1.txt 和 4.txt并且如果任何文件丢失 1.txt 和 4.txt 丢失(例如 1.txt 丢失),我需要一封邮件缺少文件名(即我们的例子中的 1.txt)。
capture missing file details in one variable
在一个变量中捕获丢失的文件详细信息
I tried to repro this capturing missing files using azure data factory.我尝试使用 azure 数据工厂重现捕获丢失文件的过程。 Below is the approach.
下面是方法。
Take a parameter of array type in the pipeline.在管道中取一个数组类型的参数。 During runtime, you can give the list of file names in a folder to be processed in this array parameter.
在运行时,您可以在此数组参数中给出要处理的文件夹中的文件名列表。
Take a get metadata activity and add a dataset in the activity.获取元数据活动并在活动中添加数据集。 Click +New in the field list and select child items as an argument.
单击字段列表中的+New和 select子项作为参数。
item: @pipeline().parameters.AllorSome
项目:
@pipeline().parameters.AllorSome
condition: @not(contains(string(activity('Get Metadata1').output.childItems),item()))
条件:
@not(contains(string(activity('Get Metadata1').output.childItems),item()))
I tried to run this pipeline.我试图运行这条管道。 During run time, four file names are given to the array parameter.
在运行时,四个文件名被赋予数组参数。
Get Metadata activity output has three file names.获取元数据活动 output 具有三个文件名。
Use this output and send it in email.使用此 output 并在 email 中发送。
Refer the MS document on How to send email - Azure Data Factory & Azure Synapse |请参阅有关如何发送 email - Azure 数据工厂和 Azure Synapse |的MS 文档Microsoft Learn for sending email.
微软学习发email。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.