I'm trying to run a local python function in Visual Studio code. I am under a proxy using a .pac file when executing the "func host start" command it gives me the following error:
Microsoft.Azure.WebJobs.Script: Error creating configuration in an external startup class. System.Net.Http: Proxy tunnel request to proxy 'http://{myProxy}:{portProxy}/' failed with status code '407'."
versions:
Found Python version 3.8.1 (py).
Azure Functions Core Tools Core Tools Version: 4.0.5382 Commit hash: N/A (64-bit) Function Runtime Version: 4.25.3.21264
Based on my research, I have seen that in some cases it works by adding the proxy in the local.settings.json file like this.
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "",
"FUNCTIONS_WORKER_RUNTIME": "python",
"AzureWebJobsFeatureFlags": "EnableWorkerIndexing",
"HTTP_PROXY": "http://{user}:{pass}@{myProxy}:{portProxy}/",
"HTTPS_PROXY": "http://{user}:{pass}@enter code here{myProxy}:{portProxy}/",
"NO_PROXY": "localhost,0.0.0.0,127.0.0.1"
}
}
But I still have the error. I continue investigating on my part.
Set the HTTPS_PROXY and HTTP_PROXY in the environment variables to allow the VSCode to run the Azure function locally.
(or)
VSCode=>Settings=>Proxyand set the proxy inHttp:Proxy.Http:Proxy Strict SSL.These settings will be reflected in Settings.json: