question

Dhanalakshmi-8414 avatar image
0 Votes"
Dhanalakshmi-8414 asked MikeUrnun answered

Running Logic Apps in Docker

Hi,

I am trying to run the Azure logic app in Docker. My Logic App flow is based http request/response based and implemented in VS code. I will be putting the message into Azure queue(managed connector) once http post is triggered. Logic App is running in docker successfully if not using azure queue connector. If we use any Azure connectors, its not working. So want to know if managed connectors (Azure connectors) will run only if Logic Apps hosted in Azure.
Any points would be helpful.
For your reference... VS code snapshot

105384-image.png



Error while using azure queue connector in Logic App:
{
"status": 400,
"source": "https://logic-apis-southindia.token.azure-apim.net:443/tokens/logic-apis-southindia/8e46fddedcf52a8e/azurequeues/faa3fae734b841a092d9f8150ca277ee/exchange",
"message": "Error from token exchange: Invalid Authorization header. Authorization header is expected in the form 'Bearer token' or 'Key token'."
}
Note: This is working good while running locally from VS code. But not working in docker.

azure-logic-apps
image.png (63.3 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

MikeUrnun avatar image
0 Votes"
MikeUrnun answered

Hello @Dhanalakshmi-8414

You'll want to pass in the JWT for the API Connection (for your Azure Queue) which the Put_a_message_on_a_queue action needs in order to talk to Azure Queues service. If you have already tested your workflow successfully prior to containerizing with Docker, you probably have an existing API Connection already so you should find the JWT for it in your local.settings.json file as the value of azurequeues-connectionKey property.

Copy the value and pass it in your docker run command as an environment variable: docker run -e WEBSITE_HOSTNAME=localhost -e azurequeues-connectionKey=<your JWT for Azure Queues> -p 8080:80 local/workflow

This will get your workflow up and running in Docker as a quick test, but afterwards, you'll definitely want to set up your Docker project such that your secrets and JWTs are better handled in a more secure way.

I found the README on the following to be helpful: https://github.com/Azure/logicapps/tree/master/azure-devops-sample#api-connections

I hope this helps, let me know if you run into issues or have any further questions.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.