输入blob在azure函数中为null

时间:2017-03-01 19:35:06

标签: c# azure azure-functions

我有一个Azure函数,我希望在我的azure函数中有一个输入blob,然后当我用c#代码读取它时,输入参数为null。

这是function.json:

{
  "bindings": [
    {
      "authLevel": "function",
      "name": "req",
      "type": "httpTrigger",
      "direction": "in"
    },
    {
      "name": "$return",
      "type": "http",
      "direction": "out"
    },
    {
      "type": "blob",
      "name": "inputBlob",
      "path": "mystorageacountname/containername/file.csv",
      "connection": "mofunctions_STORAGE",
      "direction": "in"
    }
  ],
  "disabled": false
}

C#代码打印为空:

public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, string inputBlob, TraceWriter log)
{
// trying to print the name of inputBlob variable
return req.CreateResponse(HttpStatusCode.OK, "blob", inputBlob);



}

任何帮助都很感激吗?

1 个答案:

答案 0 :(得分:1)

除了Blob的路径之外,您的示例中的所有内容都很好看。无需在路径中指定mystorageacountname。我复制粘贴你的函数并将路径更改为containername/file,它运行正常。