how to output variable to a file?

此生再无相见时 提交于 2020-01-05 03:43:07

问题


I've got a Get metadata activity that goes to an sftp server and lists the files:

Is it possible to output this list to a file without using a function??


回答1:


Is there a particular reason you have to log the output to a file? If you just call a Get Metadata task in Azure Data Factory it will be logged as part of the pipeline run and default logging anyway. You can then access those logs if required.

Alternately, a common pattern I use with Get Metadata task is a For Each loop and then host multiple tasks within the For Each, eg a Copy task to move the files from SFTP to wherever you want, and a Stored Proc task for custom logging to a database. Pass the filename from the Get Metadata task to the Stored Proc task as a parameter. Something like this:




回答2:


Is it possible to output this list to a file?

Yes, you could connect an Azure Function Activity with Get Metadata Activity.Just pass the file list as parameter into Azure Function: @activity('Get Metadata1').output

Then save the data as your need inside function.(Such as call the blob storage sdk to save the data into blob storage) Surely,Web Activity is another option to call your custom api to save the data.



来源:https://stackoverflow.com/questions/59470838/how-to-output-variable-to-a-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!