You can run Azure Logic Apps anywhere, on the Azure Functions Runtime. This enables you to deploy and run Logic Apps on your local machine, in your own datacenter, or in another cloud. And you can also run Azure Logic Apps in a Docker container.
In this post, we'll run an Azure Logic App in a Docker container.
If you want to follow along, you'll need the following:
The Logic App is triggered by an HTTP trigger and creates a queue message in Azure Storage. Let's deploy the Logic App to a container.
FROM mcr.microsoft.com/azure-functions/dotnet:3.0.14492-appservice
ENV AzureWebJobsStorage=<Your Azure Storage connection string>
ENV AZURE_FUNCTIONS_ENVIRONMENT Development
ENV AzureWebJobsScriptRoot=/home/site/wwwroot
ENV AzureFunctionsJobHost__Logging__Console__IsEnabled=true
ENV FUNCTIONS_V2_COMPATIBILITY_MODE=true
COPY ./bin/release/netcoreapp3.1/publish/ /home/site/wwwroot
Fill in your Azure Storage connection string for the AzureWebJobsStorage environment variable so that the Logic App in the container can use it.
2. Next, open the Terminal in VS Code and build and publish the project with these commands:
dotnet build -c release
dotnet publish -c release
docker build --tag local/workflowcontainer .
docker run -e WEBSITE_HOSTNAME=localhost -p 8080:80 local/workflowcontainer
"masterKey": {
"name": "master",
"value": "l6vZj8J3aLEZzOfTV7SiiP2H2eru96ajlzZNpoXm5WScABAoP1tlEg==",
"encrypted": false
}
Copy the value of the masterKey. We'll need that in the next step.
The results from the post contain the URL of the HTTP trigger to call and the query parameters to add to the URL.
The final querystring is a text, which the Logic App takes and puts in a new queue message in Azure Storage
That's it! The Logic App is now triggered and should run successfully and place a message on the Azure Storage queue, like in the image below:
Azure Logic Apps enable you to easily create complex workflows. Now, you can run Azure Logic Apps anywhere, including in a Docker container. Create a trial account today and go and check it out!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.