Azure函数不能与队列触发器一起使用 [英] Azure Functions not working with Queue Trigger

查看:100
本文介绍了Azure函数不能与队列触发器一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在此先感谢任何可以提供帮助的人.

Thanks in advance to anyone that can help.

我正在使用队列触发器在Azure中创建以下函数.

I'm creating the following function in Azure with a queue trigger.

[FunctionName("SubmitJob")]
public static async Task Run(
       [ServiceBusTrigger("jobs", Connection = "AzureStorage")]string queueItem,
       TraceWriter log,
       IBinder binder)
{
    // Code Here
}

尝试在可视化环境中进行调试时,出现以下错误,并且主机不断重启.

As soon as try and debug in visual I get the error below and the host keeps restarting.

[09/07/2018 16:06:20]主机已初始化(325ms)
[09/07/2018 16:06:20]通过实例ID'0000000000000000000000005CC4C4A2'获得的主机锁租约.
[09/07/2018 16:06:20]发生ScriptHost错误
[09/07/2018 16:06:20] System.Private.Uri:值不能为null.
[09/07/2018 16:06:20]参数名称:uriString.
[09/07/2018 16:06:20]正在停止主机

[09/07/2018 16:06:20] Host initialized (325ms)
[09/07/2018 16:06:20] Host lock lease acquired by instance ID '0000000000000000000000005CC4C4A2'.
[09/07/2018 16:06:20] A ScriptHost error has occurred
[09/07/2018 16:06:20] System.Private.Uri: Value cannot be null.
[09/07/2018 16:06:20] Parameter name: uriString.
[09/07/2018 16:06:20] Stopping Host

我正在使用Azure Functions 2. 如果我在解决方案中注释掉该函数,则主机会启动,现在它只是一个空函数,可以排除其他任何东西.

I am using Azure Functions 2. If I comment out the function in my solution the host starts ok, and it is now just an empty function to rule out anything else out.

任何关于看哪里的想法都会受到赞赏.

Any ideas on where to look would be appreciated.

推荐答案

好,

如果其他人遇到此问题,我使用模板生成器添加该函数,并使用ServiceBusTrigger属性.我想这需要它自己的配置.

If anyone else come across this I used the template generator to add the function and this used the ServiceBusTrigger attribute. I guess this needs it's own configuration.

如果要使用Azure存储队列,请改用QueueTrigger属性.

If you want to use your Azure Storage Queue use QueueTrigger Attribute instead.

再次感谢任何对此感兴趣的人.

Thanks again for anyone looking into this.

这篇关于Azure函数不能与队列触发器一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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