在“复制数据"活动中检索Blob文件名

在“复制数据

问题描述:

我从Web API下载json文件,并使用复制数据"活动和二进制副本将它们存储在blob存储中.接下来,我想使用另一个复制数据"活动从blob容器中的每个json文件中提取一个值,并将该值及其ID存储在数据库中.ID是文件名的一部分,但是有什么方法可以提取文件名?

I download json files from a web API and store them in blob storage using a Copy Data activity and binary copy. Next I would like to use another Copy Data activity to extract a value from each json file in the blob container and store the value together with its ID in a database. The ID is part of the filename, but is there some way to extract the filename?

您可以执行以下活动:

1)一个GetMetadata活动,配置一个指向blob文件夹的数据集,并将子项"添加到字段列表"中.

1) A GetMetadata activity, configure a dataset pointing to the blob folder, and add the Child Items in the Field List.

2)一个forEach活动,该活动从GetMetadata活动中获取每个项目并对其进行迭代.为此,您可以将Items配置为@activity('NameOfGetMetadataActivity').output.childItems

2) A forEach activity that takes every item from the GetMetadata activity and iterates over them. To do this you configure the Items to be @activity('NameOfGetMetadataActivity').output.childItems

3)在foreach内部,您可以使用以下函数提取每个文件的文件名:item().name

3) Inside the foreach, you can extract the filename of each file using the following function: item().name

按照您认为合适的方式继续操作之后,添加功能以获取ID或复制整个名称.

After this continue as you see fit, either adding functions to get the ID or copy the entire name.

希望这对您有帮助!