Running Azure Logic App Standard as a Docker container

Published by Sébastien DUCASSE
Category : Azure / DevOps / Logic Apps
16/04/2025

1. Introduction

 

1.1 What are Logic App Standard?

 

Azure Logic Apps Standard are integration and workflow automation services offered by Microsoft Azure. They allow you to orchestrate and manage business processes using predefined connectors (SharePoint, Azure Service Bus, Outlook, Salesforce, etc.).

One of the main advantages of Logic Apps Standard is their ease of implementation: without writing a single line of code, you can automate complex integration and data exchange scenarios. They are therefore highly valued for their fast deployment and flexibility.

 

1.2 Why can Docker containers be useful?

 

Docker is a containerization platform that allows packaging and running applications in isolated, reproducible, and portable environments. The benefits of this approach are multiple:

  • Isolation: Each container has its own configuration and dependencies, avoiding conflicts between environments.
  • Portability: A Docker image can be deployed on any platform supporting Docker (Windows, Linux, macOS, or in the cloud).
  • Scalability: It is easy to launch multiple instances of the same container to handle increased load.
  • Fast deployment: The startup time and availability of a container are much faster than with a traditional virtual machine.

In this context, running a Logic App Standard in a Docker container optimizes its portability and deployment, whether for development, testing, or production environments.

 

2. Prerequisites and Initial Configuration

 

2.1 Required Tools

 

Before starting, ensure you have the following tools:

 

2.2 Local Project

 

Your project must include:

  • A host.json file defining the main configuration of your Logic App.
  • A local.settings.json file storing specific parameters for local execution (e.g., connection keys to Azure Storage).
  • The workflows (.json files) representing your Logic App Standard definition and its connectors.

For the next steps, it is important to add the following to the local.settings.json file to set the Logic App Standard listening port to 80 instead of the default 7071:

"Host":
{
  "LocalHttpPort" : 80
}

 

At the same time, ensure that in your app settings, FUNCTIONS_WORKER_RUNTIME is set to dotnet and not nodejs:

"FUNCTIONS_WORKER_RUNTIME": "dotnet"

 

3. Preparing the Logic App Standard for Local Execution

 

3.1 Retrieving the Logic App Runtime

 

To run a Logic App Standard locally, you must use the Logic App Standard runtime (based on Azure Functions Runtime). You can either:

  • Clone an existing project containing a Logic App Standard.
  • Generate a new project from VS Code using the Logic Apps Standard extension.

Ensure that your host.json file includes the necessary runtime information, particularly the runtime version (e.g., v2).

As of January 25, 2025, the migration of Logic Apps Standard to .NET 8 has not yet been finalized by Microsoft. You must therefore use .NET 6.

 

3.2 Triggers

 

Logic Apps Standard start execution via a trigger. This can be:

  • Scheduled (timer trigger).
  • Event-based (webhook, message queue, etc.).
  • Manual.

Example of an HTTP trigger: Triggers the Logic App Standard upon receiving an HTTP request.
Example of a recurring trigger: Triggers the Logic App Standard at regular intervals (every hour, every day, etc.).

In our example, we will use an HTTP trigger.

 

3.3 Testing Locally

 

In VS Code, you can run the Logic App Standard locally:

  1. Open the folder containing your Logic App project.
  2. Ensure that your local.settings.json file contains the required configuration (AzureWebJobsStorage, etc.).
  3. Run the following command:
    func host start

This will start your Logic App Standard locally. Once running, you can send an HTTP request to the exposed URL and verify its proper execution.

To retrieve the URL, right-click on the workflow JSON file in the Logic Apps Standard extension in VS Code, then select Overview.

Workflow settings

 

4. Containerizing the Logic App Standard

 

4.1 Creating the Dockerfile

 

The first step is to create a Dockerfile in the root of your project.

If you are on an ARM architecture, keep in mind that Azure Container Instance (ACI) does not currently support hosting ARM containers. You will need to build your image for AMD architecture.

Here is a minimal example based on the .NET 6 SDK image:

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS installer-env
COPY . /src/dotnet-function-app
RUN cd /src/dotnet-function-app && \
dotnet build
RUN apt-get update
RUN apt-get -y install curl gnupg
RUN curl - fssl https://deb.nodesource.com/setup_18.x | bash -
RUN apt-get -y install nodejs
RUN npm i -g azure-functions-core-tools@4 --unsafe-perm true
RUN apt-get install -y unzip
RUN curl -sSL https://aka.ms/getvsdbgsh | /bin/sh /dev/stdin -v latest -1 ~/vsdbg
RUN apt-get update && apt-get install -y coreutils
WORKDIR /src/dotnet-function-app
ENV AzureFunctionsJobHost__Logging_Console_IsEnabled=true
EXPOSE 80
ENTRYPOINT [ "func", "host", "start" ]

 

4.2 Building the Docker Image

 

At the root of your project (where the Dockerfile is located), run:

docker build -t <nom-image>:latest

 

4.3 Testing the Image Locally

 

Once the image is built, run a local container:

docker run -p 80:80 my-logic-app:latest

 

5. Deploying the Containerized Logic App Standard on Azure Container Instances (ACI)

 

5.1 Publishing the Image to a Registry (ACR)

 

To deploy a container on ACI, the image must be available in a publicly accessible registry. Being on Azure, Azure Container Registry (ACR) is a natural choice.

Log in to Azure:

az login

Create an ACR registry:

az acr create --resource-group my-resource-group --name myacr --sku Basic

Log in to ACR:

az acr login --name myacr

Tag the image:

docker tag my-logic-app:latest myacr.azurecr.io/my-logic-app:latest

Push the image to ACR:

docker push myacr.azurecr.io/my-logic-app:latest
 
 

6. Automating the Deployment of a New Docker Image of Logic App Standard to ACR

 

Before starting, it is necessary, if not already done, to create the required service connections in Azure DevOps. You will need:

  • A service connection of type Azure Resource Manager.
  • A service connection of type Docker Registry.

Below is a minimalist example of a YAML file that builds a Docker image and pushes it to ACR.

# Fichier : azure-pipelines.yml

trigger:
  - main  

stages:
  - stage: Build_and_Push
    displayName: "Build and Push Docker Image"
    jobs:
      - job: Build
        displayName: "Build and Push to ACR"
        pool:
          vmImage: 'ubuntu-latest'
        steps:

          # 1. Vérifier que Docker est installé (généralement déjà présent sur l'agent Microsoft-hosted)
          - task: DockerInstaller@0
            displayName: "Installer Docker (si nécessaire)"

          # 2. Se connecter à Azure à l'aide du service connection
          - task: AzureCLI@2
            displayName: "Connexion à Azure"
            inputs:
              azureSubscription: "<Service connection ID>"
              scriptType: bash
              scriptLocation: inlineScript
              inlineScript: |
                echo "Connecté à Azure, subscription : $AZURE_SUBSCRIPTION_ID"

          # 3. Se connecter à ACR via Docker login
          - task: Docker@2
            displayName: "Login to ACR"
            inputs:
              command: login
              containerRegistry: "<Service connection registry ID>"
              azureSubscription: "<Service connection ID>"

          # 4. Construire et pousser l'image Docker vers ACR
          - task: Docker@2
            displayName: "Build and Push Docker Image"
            inputs:
              command: buildAndPush
              repository: "<nom acr>azurecr.io/<nom image>"
              dockerfile: "**/Dockerfile"  # Chemin vers votre Dockerfile (peut être à la racine)
              tags: |
                latest
              containerRegistry: "<Service connection registry ID>"
              azureSubscription: "<Service connection registry ID>"

  - stage: Deploy_to_ACI
    displayName: "Deploy to Azure Container Instances"
    dependsOn: Build_and_Push
    jobs:
      - job: Deploy
        displayName: "Déploiement ACI"
        pool:
          vmImage: 'ubuntu-latest'
        steps:
          # 1. Se reconnecter à Azure si nécessaire
          - task: AzureCLI@2
            displayName: "Connexion à Azure"
            inputs:
              azureSubscription: "<Service connection ID>"
              scriptType: bash
              scriptLocation: inlineScript
              inlineScript: |
                echo "Connecté à Azure, subscription : $AZURE_SUBSCRIPTION_ID"

          # 2. Créer ou mettre à jour le conteneur sur ACI
          - task: AzureCLI@2
            displayName: "Déployer la Logic App standard conteneurisée sur ACI"
            inputs:
              azureSubscription: "<Service connection ID>"
              scriptType: bash
              scriptLocation: inlineScript
              inlineScript: |
                # Variables
                ACR_NAME="<nom acr>"
                RESOURCE_GROUP="<nom ressource group>"
                CONTAINER_NAME="<nom container>"
                IMAGE_NAME="<nom image>"

                # Déployer le conteneur
                az container create \
                  --resource-group $RESOURCE_GROUP \
                  --name $CONTAINER_NAME \
                  --image $ACR_NAME.azurecr.io/$IMAGE_NAME:latest \
                  --registry-login-server $ACR_NAME.azurecr.io \
                  --registry-username <user acr> \
                  --registry-password '<mot de passe acr>' \
                  --ports 80 \
                  --os-type Linux \
                  --cpu 1 \
                  --memory 1.5 \
                  --dns-name-label <nom label dns> \
                  --ip-address Public

 
 

7. Conclusion

 

7.1 Advantages of Running a Logic App Standard in a Docker Container

 

  • Portability: Your Logic App Standard is no longer exclusively tied to Azure and can run in any Docker-compatible environment.
  • Isolation: Dependencies are isolated and controlled, reducing environment conflicts.
  • Flexible deployment: You can deploy it wherever you want, including on other clouds or on-premises.

 

7.2 Disadvantages of Running a Logic App Standard in a Docker Container

 

  • Additional cost and complexity: Managing images, registries, and containers may require additional skills and incur costs.
  • Runtime maintenance: Updating the image and runtime must be handled by you, unlike the fully managed Serverless approach on Azure.
  • Limitations of native connectors: Some connectors or features may require specific configurations or may not be available locally.