Reputation: 33
We have a problem with our logic app if we process multiple files in a For Each loop and try to do a HTTP POST to a Third-Party. Each file can have different urls/usernames/passwords for the HTTP POST step. This is why set username/password/url variables in our For Each.
Tests:
If we test all these url's with logins with postman, it works.
If we test different files with different username/password/url variables (but only one at a time per run) in our logic app, it works.
If we test files with the same username/password/url for HTTP POST variables, it works.
If we process multiple files at the same time with different usernames/passwords/url's for the HTTP POST step, it fails with some http posts in the for each showing UNAUTHORIZED, but if we check all the variables set for each file in the for each step it sets the correct username/password/url, these are correct.
Our conclusion:
If the http post gets dynamic variables (username/password/url) in a for each step some only some http post work. But for files with other login data, it fails. Looks like the HTTP connector cannot handle dynamic multiple http calls with different variables.
Our if true condition inside a for each step (unautorized error while all login and url variables are correct):
Are we doing something wrong? Please help as we are trying to move this to production.
Upvotes: 0
Views: 1317
Reputation: 478
For Each loop in Logic Apps runs its iterations in parallel by default -- so if you've designed your workflow such that correct pair of username and password for their corresponding HTTP POST are determined at runtime in each iteration, based on original order of collection the loop began -- it'll probably produce the behavior you're observing. Assuming that was the case, have you tried running the loop with Sequential option on?
Upvotes: 3