I am working on MacOS Sonoma + VSCode and I was facing the same issue.
What I have noticed is that I had an older azure-functions-core-tools
version installed via Homebrew. I removed any version previously installed and issued this command to install the latest version:
brew install azure-functions-core-tools@4
After this, I installed the Azure Functions extension in VSCode and, in my case, this tutorial worked like a charm: https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-vs-code-python .
I hope this helps.