0

Running a Single Instance of a Azure Logic App

In certain scenarios you want to run a Single Instance off a Azure Logic App every time. Scenarios were you need this is when containers are created within your flow and the other messages are also depending on the same containers.

Solution

Together with a colleague of mine we searched for a solution and finally found the answer after having contact with Microsoft. The trigger component within a Logic App has a property called “operationOptions”. This property can be set to “SingleInstance” this will make sure the Logic App will only be trigged per message.

Example

"triggers": {
  "When_a_message_is_received_in_a_topic_subscription": {
    "type": "ApiConnection",
    "inputs": {
      "host": {
        "api": {
          "runtimeUrl": "https://logic-apis-westeurope.azure-apim.net/apim/servicebus"
        },
        "connection": {
          "name": "[name]"
        }
      },
      "method": "get",
      "path": "[path]"
    },
    "operationOptions": "SingleInstance",
    "recurrence": {
      "interval": 1,
      "frequency": "Minute"
    }
  }
}

The code snip-it above is a Service Bus trigger for new messages within a topic. By adding the “operationsOptions” this Logic App will only be triggered once per message.

Disadvantage

When using the “operationsOptions” property you have to keep in mind that only one instance will run within your interval. For example when there are 5 messages within the topic, and the Logic App is triggered once every minute it will get one message from the topic every minute and will not run a new flow if the preceding message is processed. In this example it will take about 5 minutes to process the 5 messages depending on how long your Logic Apps runs.

Related Posts

Azure DevOps Automation A couple of weeks ago the rename / rebranding of Visual Studio Team Services to Azure DevOps was announced. The rebranding is a great step forward int...
AKS (Kubernetes) and no connection could be made because the target machine acti... A client of my had an error while connecting to different resources within their Kubernetes cluster in Azure (AKS). Kubectl error On the kubectl com...
Kubernetes (AKS) attached to Azure Storage (Files) Kubernetes (AKS) can be used for many situations. For a client we needed to make files available trough a Kubernetes Pod. The files needed to be share...
Resource Group deployment via ARM templates When deploying an Azure Resource Manager (ARM) template you have to create a resource group within Azure. To deploy a template via script your script ...
Azure Managed Service Identity and Local Development Instead of storing user credentials of an external system in a configuration file, you should store them in the Azure Key Vault. Before MSI (Managed S...
The securitydata Azure resource group Most of the times companies have rules in place for managing their Azure environment. The main rules that should be in place are “Azure Policies” and ...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.