Reputation: 43
Recent announcements for Azure logic apps says
"With this release you can now run Logic Apps wherever you run Azure Functions – containerized in Docker or Kubernetes environments such as AKS (Azure Kubernetes Service) or App Service for a managed PaaS experience"
Can it be hosted in docker ? I don't see any articles related to that .
Upvotes: 3
Views: 5440
Reputation: 251
The links referenced above no longer provide information about how to do the Docker support.
Piecing the replies above together I ended up doing the following:
FROM mcr.microsoft.com/azure-functions/dotnet:3.0.14492-appservice
ENV AzureWebJobsStorage={FILL-IN-YOUR-STORAGE-ACCOUNT-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
dotnet build -c release
dotnet publish -c release
docker build --tag local/workflowcontainer .
docker run -e WEBSITE_HOSTNAME=localhost -p 8080:80 local/workflowcontainer
I gathered the information above from the following website:
https://microsoft.github.io/AzureTipsAndTricks/blog/tip311.html
Upvotes: 3
Reputation: 58853
Yes, the documentation shows how you can package the app into a Docker container: https://learn.microsoft.com/en-us/azure/logic-apps/create-stateful-stateless-workflows-visual-studio-code#deploy-to-docker-container.
From the docs:
dotnet build -c release
dotnet publish -c release
docker build --tag local/workflowcontainer .
The example uses a dockerfile like this:
FROM mcr.microsoft.com/azure-functions/dotnet:3.0.14492-appservice
ENV AzureWebJobsStorage <storage-account-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
The container is then run with:
docker run -e WEBSITE_HOSTNAME=localhost -p 8080:80 local/workflowcontainer
Upvotes: 4