我的azure函数在D:\home\site\wwwroot\Simulation\output.json下生成JSON格式的输出结果(例如output.json)。 我正在努力在 OneDrive 或 Dropbox 中自动获取这些 (output.json) 结果(我不打算使用 GitHub)。 是否可以自动访问 D:\home\site\wwwroot\Simulation\output.json 位置下的结果文件并移动/重新定位到不同的位置(例如:我的家庭桌面、OneDrive、Dropbox 或ftp)。
最佳答案
听起来您想要做的是使用外部文件绑定(bind)。本质上,您将创建一个输出绑定(bind),而不是在本地保存文件。该绑定(bind)将允许您输入凭据并提供一种机制来从函数应用程序流式传输文件内容。
绑定(bind)如下所示:
{
"name": "<Name of output parameter in function signature>",
"type": "apiHubFile",
"direction": "out",
"path": "<Path of input file - see below>",
"connection": "<name of external file connection>"
}
您没有指定语言,但假设使用 C#,代码将如下所示:
public static void Run(string myQueueItem, out Stream myOutputStream, TraceWriter log)
{
log.Info($"C# Queue trigger function processed: {myQueueItem}");
// logic to write Json to the stream
}
在此处阅读完整文档:https://jlik.me/4l
关于c# - 自动从azure函数获取结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45984196/