How to terminate a for each loop in Azure logic app of Microsoft Sentinel

Nirali Shah 146 Reputation points
2024-01-11T16:10:26.94+00:00

We have created a logic app. We are iterating over each element of an array using for each loop and performing some actions inside it. Here, we have a case where we have to break the loop in between but we are not able to use Terminate inside loop as designed. So do we have an altaernative of terminating for each loop in between? FYI, we can not able to use Until loop as we have iterate over an array elemtent so for each loop is must needed.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,845 questions
Microsoft Sentinel
Microsoft Sentinel
A scalable, cloud-native solution for security information event management and security orchestration automated response. Previously known as Azure Sentinel.
977 questions
{count} votes

Accepted answer
  1. MayankBargali-MSFT 68,476 Reputation points
    2024-01-22T07:54:15.5266667+00:00

    @Nirali Shah Thanks for reaching out.

    Unfortunately, you cannot terminate the for loop action. Only using until loop you can terminate the loop. If you cannot use the until loop and want to still use the for loop then you should define a condition inside your for loop so your workflow condition inside doesn't executes further based on your condition/logic but the loop will still be executed till the end.

    Alternative you can offload this functionality to azure function where you have control over the code as per your requirement.

    Hope the above helps and let me know if you have any queries or concerns.

    Please 'Accept Answer' if it helped so that it can help others in the community looking for help on similar topics.

    0 comments No comments

0 additional answers

Sort by: Most helpful