Reputation: 33
My logic app has an HTTP trigger. Whenever I run the logic app manually or just copy and paste the URL on the browser it works as expected. However, when I use my QueueTriggered azure function to make a call to the logic app URL, the logic app just skips the send email action.
Loggic app design (shows skipped actions)
Here is the code I have for my function app:
public static async Task Run([QueueTrigger("messages", Connection = "ConnectionString")]string myQueueItem, ILogger log)
{
var httpClient = HttpClientFactory.Create();
var url = "logicAppUri";
await httpClient.GetAsync(url);
}
The content of the message is just a plain string like "test" for example.
I also tried changing the function app trigger to "When there are messages in the queue" but that also did not work.
"When there are messages in the queue" trigger
I got the same error message from Azure in both cases.
{"code":"ActionConditionFailed","message":"The execution of template action 'Send_email_(V2)' is skipped: there are no items to repeat."}
Which it doesn't make sense since there were messages in the queue.
Any idea why that's happening?
Upvotes: 0
Views: 1378
Reputation: 15754
According to some test, this issue is caused by using queue triggered function. The queue triggered function will triggered when there are new messages in queue and read the messages. So when the httpClient
call the logic app uri in funciton, there are no messages in the queue. The "Get messages" action will get a 0 size list, so the "For each" will execute 0 time.
For your requirement, you can just use "When there are messages in a queue" in logic app. Please refer to my logic app below:
As the trigger will triggered by every message, so we do not need to use "For each" to loop the messages.
Hope it helps~
Upvotes: 0