如何按日将输出绑定到Blob文件? [英] How to bind output to Blob file by day?

查看:107
本文介绍了如何按日将输出绑定到Blob文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注情绪API教程,并成功将数据输出到DocumentDB.

I'm following emotion api tutorial and got successfully output data to DocumentDB.

但是我无法使其输出到Blob.每天如何制作将情感数据附加到Blob文件的功能.如果图片中有2个人,API将返回2条情感线.

However I cannot make it work to output to blob. How to make functions to append emotion data to blob file per day. API would return 2 emotion lines if there are 2 persons in image.

http://martinabbott.azurewebsites.net/2016/06/11/fun-with-azure-functions-and-the-emotion-api/

http://martinabbott.azurewebsites.net/2016/06/11/fun-with-azure-functions-and-the-emotion-api/

我的错误是: 09:09:11.239 Microsoft.Azure.WebJobs.Host:错误索引方法"Functions.BlobTrigger". Microsoft.Azure.WebJobs.Host:无法将Blob绑定为"Microsoft.Azure.WebJobs.ICollector`1 [Submission#0 + EmotionResult]".

代码:

公共静态异步任务运行(ICloudBlob myBlob, ICollector< EmotionResult> outputEmotionBlob ,TraceWriter日志)

public static async Task Run(ICloudBlob myBlob, ICollector<EmotionResult> outputEmotionBlob, TraceWriter log)

公共类 EmotionResult
{
   公共字符串PartitionKey {get;设置;}
   公共字符串RowKey {get;设置;}
   公共字符串OutTablePartitionKey {get;放; }
    public float Anger {get;设置;}
   }

public class EmotionResult
{
   public string PartitionKey { get; set;}
   public string RowKey { get; set;}
   public string OutTablePartitionKey { get; set; }
   public float Anger { get; set;}
   }

肯尼(Kenny_I)

Kenny_I


推荐答案

您好,我想您在将outputTable添加为ICollector< EmotionResult>时,在方法级别,但是对于函数运行时,没有一个函数带有三个参数,然后在这种情况下,您必须在function.json上声明输出 或在功能配置的集成刀片中:

hello, i guess that while you added the outputTable as ICollector<EmotionResult> in method level, but for the functions runtime there's no function that took a three parameter, and then in this situation you have to declare the output on your function.json or in the Integration blade of functions configuration :

这是function.json文件:

and here is the function.json file : 

良好的编码;


这篇关于如何按日将输出绑定到Blob文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆