pythonazurevisual-studio-codeazure-functionsgrpc

Python Based Azure Function Local Debug in VsCode Fails with grpc.FutureTimeoutError()


I use the Azure extension in VS Code to create an azure function project. Below is a screenshot of my project structure, all files are default valued, created by the vsCode Azure extension wizard.

enter image description here

I start up azurite for a storage emulator and when I try to debug the function locally, I get a grpc.FutureTimeoutError(), see below

enter image description here

When i was troubleshooting, I deployed my code to a function app on my Azure subscription and it worked with no issues (logging messages confirmed everything was running). This issue only occurs when im trying to debug locally in vscode. I've tried creating both v1 and v2 functions projects and i get the same error.

Edit:

Here is my init.py function definition below. When I deploy it to a function app on the cloud it executes and I can see the log messages

enter image description here


Solution

  • Ok, this is similar to aure_bobo's answer, but his didn't work for me (he is using a Docker setup, so there are probably differences). There are some subtle differences. My setup - Windows Server 2022 running on a corporate VPN.

    Setting the no_proxy environment variable worked, however, as you need to restart VS Code after applying it, there's no point in running it as a command in terminal (as you then need to restart VS Code, which cancels that change). Instead, search Windows for 'Edit environment variables for your account' and add a new variable, with name no_proxy and value localhost,127.0.0.1. Then restart VS Code and hit F5 to run local debug, where you should see it complete successfully and output 2 Functions triggers.

    Another response to a similar question mentioned turning off the VS Code proxy setting for 'strict SSL', but I've found this made no difference.