【发布时间】:2020-04-26 16:43:14
【问题描述】:
我的逻辑应用有一个 HTTP 触发器。每当我手动运行逻辑应用程序或只是将 URL 复制并粘贴到浏览器上时,它都会按预期工作。但是,当我使用 QueueTriggered azure 函数调用逻辑应用 URL 时,逻辑应用只会跳过发送电子邮件操作。
Loggic app design (shows skipped actions)
这是我的函数应用的代码:
public static async Task Run([QueueTrigger("messages", Connection = "ConnectionString")]string myQueueItem, ILogger log)
{
var httpClient = HttpClientFactory.Create();
var url = "logicAppUri";
await httpClient.GetAsync(url);
}
消息的内容只是一个简单的字符串,例如“test”。
我还尝试将函数应用触发器更改为“当队列中有消息时”,但这也不起作用。
"When there are messages in the queue" trigger
在这两种情况下,我都从 Azure 收到了相同的错误消息。
{"code":"ActionConditionFailed","message":"The execution of template action 'Send_email_(V2)' is skipped: there are no items to repeat."}
这没有意义,因为队列中有消息。
知道为什么会这样吗?
【问题讨论】:
-
我想我需要在您的流程中提供更多详细信息才能了解数据如何通过
-
不要使用
async void使用async Task。考虑添加一些日志记录,可能会引发错误 -
我怀疑这是如何处理您在 for each 循环之前从队列中检索的消息的。你能在那里提供更多细节吗?似乎没有阅读任何消息?
-
嗨,Ygor,请参考我在下面提供的解决方案。如果对您的问题有帮助,请accept作为答案(点击我的答案旁边的复选标记将其从灰色切换为已填充),在此先感谢~
-
感谢您的 cmets。我已添加有关该问题的更多信息。
标签: c# azure-functions azure-logic-apps