Azure / azure-functions-dapr-extension

Extension for interacting with Dapr APIs from an Azure Function
MIT License
95 stars 33 forks source link

Azure Function Extension to show warning message if app_port is given for non-trigger dapr functions #153

Open ASHIQUEMD opened 9 months ago

ASHIQUEMD commented 9 months ago

Problem: The console message doesn't clearly inform the user when the app_port is set, but there's no listener (app) on that port. This situation occurs when using a function app with Dapr input/output bindings and without Dapr triggers, specifying an app_port with Dapr. Dapr keeps attempting to connect to the app on the specified port, even if there's no app running on that port.

Expectation: When the user provides an app_port to Dapr, and there's no app running on that port, there should be a log message indicating that Dapr is trying to communicate on that port, but no app is available.

Message in console:

the current message is below:time="2023-09-26T10:24:23.9718899+05:30" level=info msg="internal gRPC server is running on port 65226" app_id=funcorderapp instance= scope=dapr.runtime type=log ver=1.10.6 time="2023-09-26T10:24:23.9718899+05:30" level=info msg="application protocol: http. waiting on port 3003. This will block until the app is listening on that port." app_id=funcname instance= scope=dapr.runtime type=log ver=1.10.6

Here is the sample project: https://github.com/ASHIQUEMD/azure-func-isolated-dapr Dapr cli command to run the app: dapr run --app-id functionapp --app-port 3001 --dapr-http-port 3501 -- func host start

Phiph commented 9 months ago

Hey @ASHIQUEMD Would you be able to provide an example project, and the commands you're using to run Dapr and the function host?

ASHIQUEMD commented 9 months ago

@Phiph, I have update issue with project links, please have a look.

Phiph commented 9 months ago

I've had a look, and I'm don't have any ideas around it at the moment. It appears that's an internal call for DAPR to register and set the app up with its configuration, along with starting the Actor and Workflow Engine.

Do you expect a Warn Message for anyone using the SDK without a API endpoint application with something along the lines of:

Dapr is expecting to communicate with your application, but it does not have a HTTP port. Binding only function apps are not yet supported