Azure / Azure/azure-functions-dotnet-worker
dotnet isolated EventGrid Function Not listening when debugging locally
- Dominant language
- C#
- Stars
- 466
- Forks
- 215
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 7
Description
When debugging locally, the console window says that a host lock lease acquired by instance ID, but the function is not listening on a port. I was able to confirm by running netstat -ano | findstr 2372 (2372 is the PID output in the console debug window). I can only replicate the issue using isolated .NET 6 and .NET 7 function and the preview Microsoft.Azure.Functions.Worker.Extensions namespace. Running an in-process function using Microsoft.Azure.WebJobs.Extensions works without issue. What's interesting is that if I publish the isolated function to Azure, it is working as expected, the issue is only debugging locally.
Here is the console output:
Azure Functions Core Tools
Core Tools Version: 4.0.5198 Commit hash: N/A (64-bit)
Function Runtime Version: 4.21.1.20667
[2023-07-10T14:47:50.871Z] Found C:\repos\graph-event\graph-event\graph-event.csproj. Using for user secrets file configuration.
Functions:
EventHandler: eventGridTrigger
For detailed output, run func with --verbose flag.
[2023-07-10T14:47:51.836Z] Azure Functions .NET Worker (PID: 2372) initialized in debug mode. Waiting for debugger to attach...
[2023-07-10T14:47:53.078Z] Worker process started and initialized.
[2023-07-10T14:47:56.729Z] Host lock lease acquired by instance ID '000000000000000000000000601AA99F'.
Here is the results from netstat -ano | findstr 2372 showing no listening port. Indeed if I try to send an event to the default port 7071 in postman, I get Error: connect ECONNREFUSED 127.0.0.1:7071
netstat -ano | findstr 16648
TCP 127.0.0.1:21883 127.0.0.1:21880 ESTABLISHED 16648
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.