I know this is a thread that is already old at this point but thought I'd add my resolution, since this did not work for me. I'm running Python Functions w/ Python 3.12. Func Core Tools 4 on Windows and using VSCode. Same errors.
To resolve the error I had to:
1- Add a line to my local.settings.json file to listen for a debugger: here is the full .json file
{ "IsEncrypted": false, "Values": { "AzureWebJobsStorage": "UseDevelopmentStorage=true", "AzureWebJobsSecretStorageType": "files", "FUNCTIONS_WORKER_RUNTIME": "python", "AzureWebJobsFeatureFlags": "EnableWorkerIndexing", "languageWorkers__python__arguments": "-m debugpy --listen 0.0.0.0:9091" } }
2- install debugpy on my venv in the project directory.
Hope this helps someone in the same situation . I'm not sure why the issue started yet.. but it has solved it