如何将变量输出到文件? [英] how to output variable to a file?

查看:74
本文介绍了如何将变量输出到文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Get metadata活动,该活动转到sftp服务器并列出文件:

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

是否可以在不使用功能的情况下将此列表输出到文件?

推荐答案

是否有特定的原因需要将输出记录到文件中?如果仅在Azure数据工厂中调用获取元数据"任务,则它将作为管道运行和默认日志记录的一部分进行记录.然后,您可以根据需要访问这些日志.

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.

或者,我在获取元数据任务中使用的常见模式是 For Each 循环,然后在 For Each 中托管多个任务,例如,将文件从SFTP移至所需位置的复制任务,以及用于自定义日志记录到数据库的存储过程任务.将文件名从获取元数据任务传递到 Stored Proc 任务作为参数.像这样:

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:

这篇关于如何将变量输出到文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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