c# - 自动从azure函数获取结果

标签 c# azure azure-sql-database azure-functions

我的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/

相关文章:

c# - 如何在 Unity 中将混音器的音量设置为 slider 的音量?

azure - 使用服务主体从 DataBricks 连接到 Azure SQL 数据库

sql-server - 将数据库部署到 Azure SQL 失败,找不到 sp_MSforeachtable

c# - 透明地分解 Azure 中托管的 ASP.NET 网站

Azure REST API 创建容器,.NET 客户端配置文件,403 禁止,找到的 MAC 签名与任何计算的签名不同

r - 'Extending U-SQL scripts with R code in Visual Studio' 可用吗?

javascript - 如何使用javascript在Azure SQL Server上执行操作?

c# - 带有 Sublime 的 ScriptCS

C# Windows RT 文件名太长

c# - GridView.DataSource 在 PostBack 期间为 null