Debugging Azure Python functions using VS Code IDE "connect ECONNREFUSED 127.0.0.1:9091"
See original GitHub issue-
VS Code Version:
-
Azurite Version 3.19.0
-
Core Tools Version: 4.0.4736
-
Function Runtime Version: 4.8.1.18957
Steps to Reproduce:
-
Start Azurite local storage emulator (for testing durable functions). F1 > Azurite: Start. Azurite service starts successfully.
-
Hit F5 to debug. Requirements checked/installed, functions are listed, then error box appears.
-
Workarounds: Can usually hit Cancel and F5 again, and then debugging starts successfully -OR- can just hit Cancel and run functions successfully without debugging
A colleague and I have both experienced this issue on 2 different machines. Even though we have a workaround we’ve been attempting for months to eliminate original error, with no success. Issue has persisted through multiple VS Code versions (version noted above is currently installed).
Troubleshooting steps taken:
- Uninstall / Reinstall VS Code
- Uninstall / Reinstall Azure Core Tools v3 and v4
- Downgraded and upgraded Azure Core Tools v3 <-> v4 - Adjusted Function Runtime Version to target Function Version 3 and 4 accordingly.
- Deleted Azure Functions extension from %USER%.vscode\extension
- Reinstalled Azure Functions extension
- Explicitly install Azure Functions extension bindings/bundles
- My colleague posted to on StackOverflow (Unable to debug Python Azure function in VS Code IDE. Getting connect ECONNREFUSED 127.0.0.1:9091 error - Stack Overflow) We both tried the suggestions.
- Disable all extensions. This causes a different error.
- Disable only Azurite extension and switch from local storage to storage account connection. Same (original error). Workarounds still work.
Note: We are on a corp VPN. However, the issue happens regardless of whether we are connected to the VPN
Possibly Related: Sometimes, after closing VS Code completely and reopening, when I try debugging, I get VS Code error: could not find the task ‘func: host start’ (image above).
However, if I open a new terminal and run ‘func host start’, it runs successfully without any issue.
Can usually eliminate it by uninstalling Azure Functions extension and reinstalling via extensions blade. Not exactly sure why this works, but have had to do it numerous times.
This happens every so often, but can’t reproduce it reliably or identify a specific pattern.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (1 by maintainers)
Sounds good - thank you @nturinski. The possibility of a race condition is something that came up during our debugging attempts and discussions with MS support staff.
I’ve re-installed core tools numerous times, as well as VS Code itself and many of the extensions. None of that fixes the issue for me on Windows 10.