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.
Docker is a containerization platform that allows packaging and running applications in isolated, reproducible, and portable environments. The benefits of this approach are multiple:
In this context, running a Logic App Standard in a Docker container optimizes its portability and deployment, whether for development, testing, or production environments.
Before starting, ensure you have the following tools:
Your project must include:
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:
At the same time, ensure that in your app settings, FUNCTIONS_WORKER_RUNTIME is set to dotnet and not nodejs:
To run a Logic App Standard locally, you must use the Logic App Standard runtime (based on Azure Functions Runtime). You can either:
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.
Logic Apps Standard start execution via a trigger. This can be:
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.
In VS Code, you can run the Logic App Standard locally:
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.
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:
At the root of your project (where the Dockerfile is located), run:
docker build -t <nom-image>:latest
Once the image is built, run a local container:
docker run -p 80:80 my-logic-app:latest
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
Before starting, it is necessary, if not already done, to create the required service connections in Azure DevOps. You will need:
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