Azure Functions won't start due to port is unavailable exception #6699
Labels
area-integrations
Issues pertaining to Aspire Integrations packages
area-orchestrator
azure
Issues associated specifically with scenarios tied to using Azure
azure-functions
Issues related to the Azure Functions integration
Milestone
Is there an existing issue for this?
Describe the bug
When running a .NET Aspire solution after the first time, containing an Azure Functions project with the https://learn.microsoft.com/en-us/dotnet/aspire/serverless/functions?tabs=dotnet-cli&pivots=dotnet-cli integration, the functions will not start because of the fact that the configured port is still in use.
Seems the cleanup process does not stop all processes.
Expected Behavior
All running processes are stopped when pressing ctrl+c to shut down the running Aspire project
Steps To Reproduce
Create an Aspire project containing an Azure function project
Run the Aspire apphost for the first time with
dotnet run --project AspireFunctions.AppHost
See that the function app is loaded and working
Stop the AppHost with ctrl+c
Run the Aspire apphost for a second time with
dotnet run --project AspireFunctions.AppHost
See that the function app fails to start due to port still being in use
Project running on MacOS
Exceptions (if any)
Port 7288 is unavailable
.NET Version info
9.0.100
Anything else?
Project running on MacOS
List running processes with
sudo lsof -i -P -n | grep LISTEN
and see that dotnet still has running itemsThe text was updated successfully, but these errors were encountered: