问题
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