【发布时间】:2016-11-03 19:03:09
【问题描述】:
如何将我的输出绑定到异步函数?将参数设置为out 的常用方法不适用于异步函数。
示例
using System;
public static async void Run(string input, TraceWriter log, out string blobOutput)
{
log.Info($"C# manually triggered function called with input: {input}");
await Task.Delay(1);
blobOutput = input;
}
这会导致编译错误:
[timestamp] (3,72): error CS1988: Async methods cannot have ref or out parameters
使用的绑定(仅供参考)
{
"bindings": [
{
"type": "blob",
"name": "blobOutput",
"path": "testoutput/{rand-guid}.txt",
"connection": "AzureWebJobsDashboard",
"direction": "out"
},
{
"type": "manualTrigger",
"name": "input",
"direction": "in"
}
],
"disabled": false
}
【问题讨论】:
标签: c# azure asynchronous azure-functions