自动从 azure 函数获取结果
Automatically, getting result from azure function
我的 azure 函数在 D:\home\site\wwwroot\Simulation\output.json[=14= 下以 JSON 格式(例如 output.json)生成输出结果].
我正在努力在 OneDrive 或 Dropbox 中自动获得这些 (output.json) 结果(我不想使用 GitHub)。
是否可以自动访问 D:\home\site\wwwroot\Simulation\output.json 位置和 move/relocate 不同位置的结果文件(例如:我的家庭桌面, OneDrive、Dropbox 或 ftp).
要将输出文件放入 OneDrive 或 DropBox 等外部存储中,请使用 External File bindings。
您应该避免在本地存储结果,因为随着时间的推移,函数可能 运行 在不同的实例上(如果在消费计划中)。
听起来你想做的是使用外部文件绑定。本质上,您将创建一个输出绑定,而不是在本地保存文件。该绑定将允许您输入您的凭据并提供一种机制来从您的函数应用流式传输文件内容。
绑定如下所示:
{
"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
我的 azure 函数在 D:\home\site\wwwroot\Simulation\output.json[=14= 下以 JSON 格式(例如 output.json)生成输出结果]. 我正在努力在 OneDrive 或 Dropbox 中自动获得这些 (output.json) 结果(我不想使用 GitHub)。 是否可以自动访问 D:\home\site\wwwroot\Simulation\output.json 位置和 move/relocate 不同位置的结果文件(例如:我的家庭桌面, OneDrive、Dropbox 或 ftp).
要将输出文件放入 OneDrive 或 DropBox 等外部存储中,请使用 External File bindings。
您应该避免在本地存储结果,因为随着时间的推移,函数可能 运行 在不同的实例上(如果在消费计划中)。
听起来你想做的是使用外部文件绑定。本质上,您将创建一个输出绑定,而不是在本地保存文件。该绑定将允许您输入您的凭据并提供一种机制来从您的函数应用流式传输文件内容。
绑定如下所示:
{
"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