[英]How can I bind my Azure Functions return value to a output?
使用Azure函數時,是否可以將輸出綁定到函數的返回值?
是的,如果您將綁定名稱設置為$return
那么您的函數返回的任何內容都將被發送到您的輸出綁定。 這將避免您必須為函數指定out <T> boundParam
參數。
使用手動觸發器
{
"bindings": [
{
"type": "blob",
"name": "$return",
"path": "testoutput/{rand-guid}.txt",
"connection": "AzureWebJobsDashboard",
"direction": "out"
},
{
"type": "manualTrigger",
"name": "input",
"direction": "in"
}
],
"disabled": false
}
using System;
public static string Run(string input, TraceWriter log)
{
log.Info($"C# manually triggered function called with input: {input}");
await Task.Delay(1);
return input;
}
using System;
public static async Task<string> Run(string input, TraceWriter log)
{
log.Info($"C# manually triggered function called with input: {input}");
await Task.Delay(1);
return input;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.