dapr-sandbox / dapr-logicapps-extension

Run Cloud Native workflows on any environment using Dapr
Apache License 2.0
135 stars 29 forks source link

Azure ContainerApp provisioning "failed" #80

Closed sf-declanomalley closed 2 years ago

sf-declanomalley commented 2 years ago

Hi,

sorry if I'm posting this in the wrong place, if i am please redirect me to where i can get some help.

I'm trying to publish daprio/workflows:0.2.2 to azure container apps and it's failing to provision.

the logs state the dapr sidecar spins up fine and is waiting for the application. the image then runs as expected and the logs appear as:

"Loading Configuration Creating Edge Configuration Registering Web Environment Loading workflow: email-orchestrator-workflow.json Flow Created Loading workflow: email-sender-workflow.json Flow Created Dapr LogicApps Server listening on port 50003"

it then continuous to repeat the above multiple times and is still continuing to do so now.

Replicating this locally by spinning up a docker container using the following command docker run -p 50003:50003 --env STORAGE_ACCOUNT_KEY=abc --env STORAGE_ACCOUNT_NAME=abc -v C:\Users....\workflows:/workflows daprio/workflows:0.2.2 dotnet app/Dapr.Workflows.dll --workflows-path /workflows

the image runs with the same output above

i then run a sidecar dapr run --app-id workflows --app-protocol grpc --dapr-http-port 3500 --app-port 50003 --log-level debug

the dapr sidecar log indicates its still waiting for port 50003 to be listening.

if i try and invoke the grpc server on port 50003 i get status code "14 unavailable". i feel like i'm missing something simple here and it should all work as expected.

if i run the project outside of a containerised environment it works fine: dapr run --app-id workflows --app-protocol grpc --dapr-http-port 3500 --app-port 50003 -- dotnet run --workflows-path ../../workflows

am I missing something about running containerised? hopefully you can help. i hoped copying the example deploy file would just work as expected.

sf-declanomalley commented 2 years ago

quick update. I've got the environment working locally using docker compose. I've come to realise that the grpc dotnet logic app service is running on localhost:50003 inside of the container network and trying to access localhost inside the container network from the windows host environment is not possible, or it is but I've still not figured out how! the container apps environment is still restarting so I still have that issue. will post again if i find anything.

sf-declanomalley commented 2 years ago

https://docs.microsoft.com/en-gb/azure/container-apps/health-probes?tabs=arm-template adding custom health probes to the container apps port 50003 still didn't work.

container apps cannot communicate over localhost for the probe apparently

I have create a new image based off of dapr.workflows that binds to the local interface rather then localhost. program.cs:72 Ports = { new ServerPort("0.0.0.0", ServerPort, ServerCredentials.Insecure) }

the image now runs successfully in container apps with a custom probe to port 50003.