#r "Microsoft.WindowsAzure.Storage"
using System;
using System.Net;
using Microsoft.WindowsAzure.Storage.Table;
public class Entity : TableEntity
{
public int num {get; set;}
}
public static HttpResponseMessage Run(HttpRequestMessage req, string partition,
string rowkey, Entity inputEntity, out Entity outputEntity)
{
if (inputEntity == null)
outputEntity = new Entity { PartitionKey = partition, RowKey = rowkey, num = 1};
else
{
inputEntity.num += 1;
outputEntity = inputEntity;
}
return req.CreateResponse(HttpStatusCode.OK, $"Done, num = {outputEntity.num}");
}
1 回答
请阅读"Storage table input binding"阅读"Storage table input binding" . 它有
function.json
和Node函数的示例 .如果某些内容仍然不明确,请使用确切的问题优化您的问题 .
更新:
以下是针对您精炼问题的示例解决方案 . 我只在C#中使用它,我希望你可以派生节点实现 .
csx
function.json
: