Failure to debug Python Functions using VSCode + WSL2 + Ubuntu 22.04

101 views Asked by At

Tools

  • VSCode
  • WSL2
  • Ubuntu 22.04
  • Python 3.10.12

I am using the Code created when using Workspace/New Project... Project consistently fails with: ConnectionRefusedError: [Errno 111]

Investigative information

I have tried everything I can find on the internet including #2808; Python works on this VM; I have deleted the project and started again and restarted WSl2

If I run: func host start / func start the function works with: p://localhost:7071/api/http_trigger1?name="test"

If I try to make a C# function works as expected.

I modified launch.json to include: "command": "host start --verbose", Attached is the Output:

  • Executing task: .venv/bin/python -m pip install -r requirements.txt

Requirement already satisfied: azure-functions in ./.venv/lib/python3.10/site-packages (from -r requirements.txt (line 5)) (1.18.0)

  • Terminal will be reused by tasks, press any key to close it.

  • Executing task: . .venv/bin/activate && func host start --verbose

Found Python version 3.10.12 (python3).

              %%%%%%
             %%%%%%
        @   %%%%%%    @
      @@   %%%%%%      @@
   @@@    %%%%%%%%%%%    @@@
 @@      %%%%%%%%%%        @@
   @@         %%%%       @@
     @@      %%%       @@
       @@    %%      @@
            %%
            %


Azure Functions Core Tools
Core Tools Version:       4.0.5455 Commit hash: N/A  (64-bit)
Function Runtime Version: 4.27.5.21554

[2024-02-23T18:20:57.501Z] Starting metrics publisher for container : wsl. Publishing endpoint is https://:31002/api/metrics
[2024-02-23T18:20:57.557Z] Initializing LinuxContainerActivityPublisher
[2024-02-23T18:20:57.557Z] Starting LinuxContainerActivityPublisher
MS_FUNCTION_LOGS 5,,,,,ScriptApplicationHostOptionsSetup,"","ScmRunFromPackage is empty.",4.27.5.21554,2024-02-23T18:20:57.5600849Z,,"",,,,WSL,,,,
[2024-02-23T18:20:57.607Z] Building host: version spec: , startup suppressed: 'False', configuration suppressed: 'False', startup operation id: '93a298d3-ebf7-4eac-aea6-e67cd4fb582f'
[2024-02-23T18:20:57.612Z] Reading host configuration file '/workspaces/functionApp/host.json'
[2024-02-23T18:20:57.613Z] Host configuration file read:
[2024-02-23T18:20:57.613Z] {
[2024-02-23T18:20:57.613Z]   "version": "2.0",
[2024-02-23T18:20:57.614Z]   "logging": {
[2024-02-23T18:20:57.614Z]     "applicationInsights": {
[2024-02-23T18:20:57.614Z]       "samplingSettings": {
[2024-02-23T18:20:57.614Z]         "isEnabled": true,
[2024-02-23T18:20:57.614Z]         "excludedTypes": "Request"
[2024-02-23T18:20:57.614Z]       }
[2024-02-23T18:20:57.614Z]     }
[2024-02-23T18:20:57.615Z]   },
[2024-02-23T18:20:57.615Z]   "extensionBundle": {
[2024-02-23T18:20:57.615Z]     "id": "Microsoft.Azure.Functions.ExtensionBundle",
[2024-02-23T18:20:57.615Z]     "version": "[4.*, 5.0.0)"
[2024-02-23T18:20:57.615Z]   }
[2024-02-23T18:20:57.615Z] }
[2024-02-23T18:20:57.654Z] FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language: powershell
[2024-02-23T18:20:57.665Z] FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language: node
[2024-02-23T18:20:57.686Z] FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language: java
[2024-02-23T18:20:57.687Z] Looking for extension bundle Microsoft.Azure.Functions.ExtensionBundle at /FuncExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle
[2024-02-23T18:20:57.687Z] Looking for extension bundle Microsoft.Azure.Functions.ExtensionBundle at /root/site/wwwroot/.azurefunctions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle
[2024-02-23T18:20:57.687Z] Looking for extension bundle Microsoft.Azure.Functions.ExtensionBundle at /root/data/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle
[2024-02-23T18:20:57.688Z] Found a matching extension bundle at /root/data/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/4.12.0
[2024-02-23T18:20:57.703Z] Loading functions metadata
[2024-02-23T18:20:57.705Z] Worker indexing is enabled
[2024-02-23T18:20:57.712Z] Fetching metadata for workerRuntime: python
[2024-02-23T18:20:57.712Z] Reading functions metadata (Worker)
[2024-02-23T18:20:58.383Z] Language Worker Process exited. Pid=2686.
[2024-02-23T18:20:58.383Z] python3 exited with code 1 (0x1). ConnectionRefusedError: [Errno 111] Connection refused,ConnectionRefusedError: [Errno 111] Connection refused.
[2024-02-23T18:21:02.566Z] Posting health event {"EventTime":"2024-02-23T18:21:02.5542407Z","EventType":0,"Source":"Microsoft.Azure.WebJobs.Script.WebHost.ContainerManagement.LinuxContainerActivityPublisher","Details":"SpecializationCompleted"}
[2024-02-23T18:21:02.578Z] PublishSpecializationCompleteEvent failed with System.InvalidOperationException: An invalid request URI was provided. Either the request URI must be an absolute URI or BaseAddress must be set.
[2024-02-23T18:21:02.579Z]    at System.Net.Http.HttpClient.PrepareRequestMessage(HttpRequestMessage request)
[2024-02-23T18:21:02.579Z]    at System.Net.Http.HttpClient.CheckRequestBeforeSend(HttpRequestMessage request)
[2024-02-23T18:21:02.579Z]    at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request, HttpCompletionOption completionOption, CancellationToken cancellationToken)
[2024-02-23T18:21:02.579Z]    at System.Net.Http.HttpClient.SendAsync(HttpRequestMessage request)
[2024-02-23T18:21:02.579Z]    at Microsoft.Azure.WebJobs.Script.WebHost.Management.MeshServiceClient.SendAsync(IEnumerable`1 formData) in /_/src/WebJobs.Script.WebHost/Management/MeshServiceClient.cs:line 154
[2024-02-23T18:21:02.579Z]    at Microsoft.Azure.WebJobs.Script.WebHost.Management.MeshServiceClient.NotifyHealthEvent(ContainerHealthEventType healthEventType, Type source, String details) in /_/src/WebJobs.Script.WebHost/Management/MeshServiceClient.cs:line 104
[2024-02-23T18:21:02.579Z]    at Microsoft.Azure.WebJobs.Script.WebHost.ContainerManagement.LinuxContainerActivityPublisher.PublishSpecializationCompleteEvent() in /_/src/WebJobs.Script.WebHost/ContainerManagement/LinuxContainerActivityPublisher.cs:line 122
MS_FUNCTION_METRICS ,,,hostjsonfileconfigurationsource.loadhostconfigurationsource.initializehostconfig,0,0,0,1,4.27.5.21554,2024-02-23T18:21:27.4964945Z,"{'IsStopwatchHighResolution': True}",WSL,,,,
MS_FUNCTION_METRICS ,,,hostjsonfileconfigurationsource.loadhostconfigurationsource.loadhostconfig,0,0,0,1,4.27.5.21554,2024-02-23T18:21:27.4964945Z,"{'IsStopwatchHighResolution': True}",WSL,,,,
MS_FUNCTION_METRICS ,,,workerconfigfactory.getconfigs.buildworkerproviderdictionary.addprovider./usr/lib/azure-functions-core-tools-4/workers/powershell,15,15,15,1,4.27.5.21554,2024-02-23T18:21:27.4964945Z,"{'IsStopwatchHighResolution': True}",WSL,,,,
MS_FUNCTION_METRICS ,,,workerconfigfactory.getconfigs.buildworkerproviderdictionary.addprovider./usr/lib/azure-functions-core-tools-4/workers/node,0,0,0,1,4.27.5.21554,2024-02-23T18:21:27.4964945Z,"{'IsStopwatchHighResolution': True}",WSL,,,,
MS_FUNCTION_METRICS ,,,workerconfigfactory.getconfigs.buildworkerproviderdictionary.addprovider./usr/lib/azure-functions-core-tools-4/workers/java,20,20,20,1,4.27.5.21554,2024-02-23T18:21:27.4964945Z,"{'IsStopwatchHighResolution': True}",WSL,,,,
MS_FUNCTION_METRICS ,,,workerconfigfactory.getconfigs.buildworkerproviderdictionary.addprovider./usr/lib/azure-functions-core-tools-4/workers/python,10,10,10,1,4.27.5.21554,2024-02-23T18:21:27.4964945Z,"{'IsStopwatchHighResolution': True}",WSL,,,,
MS_FUNCTION_METRICS ,,,hostjsonfileconfigurationsource.loadhostconfigurationsource,5,5,5,1,4.27.5.21554,2024-02-23T18:21:27.4964945Z,"{'IsStopwatchHighResolution': True}",WSL,,,,
MS_FUNCTION_METRICS ,,,workerprocess.start,5,5,5,1,4.27.5.21554,2024-02-23T18:21:27.4964945Z,"{'IsStopwatchHighResolution': True}",WSL,,,,
MS_FUNCTION_METRICS ,,,workerconfigfactory.getconfigs,49,49,49,1,4.27.5.21554,2024-02-23T18:21:27.4964945Z,"{'IsStopwatchHighResolution': True}",WSL,,,,
[2024-02-23T18:21:57.757Z] Starting worker process failed
[2024-02-23T18:21:57.757Z] Microsoft.Azure.WebJobs.Script.Grpc: The operation has timed out.
[2024-02-23T18:21:57.759Z] Failed to start language worker process for runtime: (null). workerId:c8db8ef9-b555-4ed0-bf41-9ae967be7b64
[2024-02-23T18:21:57.761Z] Removing errored webhost language worker channel for runtime: python workerId:c8db8ef9-b555-4ed0-bf41-9ae967be7b64
[2024-02-23T18:21:57.761Z] Microsoft.Azure.WebJobs.Script.Grpc: The operation has timed out.
[2024-02-23T18:21:57.786Z] 0 functions loaded
[2024-02-23T18:21:57.789Z] Looking for extension bundle Microsoft.Azure.Functions.ExtensionBundle at /FuncExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle
[2024-02-23T18:21:57.789Z] Looking for extension bundle Microsoft.Azure.Functions.ExtensionBundle at /root/site/wwwroot/.azurefunctions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle
[2024-02-23T18:21:57.789Z] Looking for extension bundle Microsoft.Azure.Functions.ExtensionBundle at /root/data/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle
[2024-02-23T18:21:57.789Z] Found a matching extension bundle at /root/data/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/4.12.0
[2024-02-23T18:21:57.790Z] Fetching information on versions of extension bundle Microsoft.Azure.Functions.ExtensionBundle available on https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/index.json
[2024-02-23T18:21:57.827Z] Skipping bundle download since it already exists at path /root/data/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/4.12.0
[2024-02-23T18:21:57.828Z] Loading extension bundle from /root/data/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/4.12.0/bin_v3/linux-x64
[2024-02-23T18:21:57.829Z] Script Startup resetting load context with base path: '/root/data/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/4.12.0/bin_v3/linux-x64'.
[2024-02-23T18:21:57.837Z] Reading host configuration file '/workspaces/functionApp/host.json'
[2024-02-23T18:21:57.837Z] Host configuration file read:
[2024-02-23T18:21:57.837Z] {
[2024-02-23T18:21:57.837Z]   "version": "2.0",
[2024-02-23T18:21:57.837Z]   "logging": {
[2024-02-23T18:21:57.837Z]     "applicationInsights": {
[2024-02-23T18:21:57.837Z]       "samplingSettings": {
[2024-02-23T18:21:57.837Z]         "isEnabled": true,
[2024-02-23T18:21:57.837Z]         "excludedTypes": "Request"
[2024-02-23T18:21:57.837Z]       }
[2024-02-23T18:21:57.837Z]     }
[2024-02-23T18:21:57.837Z]   },
[2024-02-23T18:21:57.837Z]   "extensionBundle": {
[2024-02-23T18:21:57.837Z]     "id": "Microsoft.Azure.Functions.ExtensionBundle",
[2024-02-23T18:21:57.837Z]     "version": "[4.*, 5.0.0)"
[2024-02-23T18:21:57.837Z]   }
[2024-02-23T18:21:57.837Z] }
MS_FUNCTION_LOGS 5,,,,,Host.LanguageWorkerConfig,"","Workers Directory set to: /usr/lib/azure-functions-core-tools-4/workers",4.27.5.21554,2024-02-23T18:21:57.9843144Z,,"",,7719dbaf-0319-45f8-a0be-6dacebbe12c4,,WSL,,,,
MS_FUNCTION_LOGS 5,,,,,Host.LanguageWorkerConfig,"","Found worker config: /usr/lib/azure-functions-core-tools-4/workers/powershell/worker.config.json",4.27.5.21554,2024-02-23T18:21:57.9845090Z,,"",,7719dbaf-0319-45f8-a0be-6dacebbe12c4,,WSL,,,,
MS_FUNCTION_LOGS 5,,,,,Host.LanguageWorkerConfig,"","EnvironmentVariable FUNCTIONS_WORKER_RUNTIME: python",4.27.5.21554,2024-02-23T18:21:57.9846553Z,,"",,7719dbaf-0319-45f8-a0be-6dacebbe12c4,,WSL,,,,
MS_FUNCTION_LOGS 4,,,,,Host.LanguageWorkerConfig,"","FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language: powershell",4.27.5.21554,2024-02-23T18:21:57.9855122Z,,"",,7719dbaf-0319-45f8-a0be-6dacebbe12c4,,WSL,,,,
[2024-02-23T18:21:57.992Z] MS_FUNCTION_AZURE_MONITOR_EVENT 4,localhost:7071,Microsoft.Web/sites/functions/log,FunctionAppLogs,,"{'appName':'','roleInstance':'wsl','message':'FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language: powershell','category':'Host.LanguageWorkerConfig','hostVersion':'4.27.5.21554','hostInstanceId':'7719dbaf-0319-45f8-a0be-6dacebbe12c4','level':'Information','levelId':2,'processId':2651}",WSL,,02/23/2024 18:21:57
FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language: powershell
MS_FUNCTION_LOGS 5,,,,,Host.LanguageWorkerConfig,"","Found worker config: /usr/lib/azure-functions-core-tools-4/workers/python/worker.config.json",4.27.5.21554,2024-02-23T18:21:57.9927588Z,,"",,7719dbaf-0319-45f8-a0be-6dacebbe12c4,,WSL,,,,
MS_FUNCTION_LOGS 5,,,,,Host.LanguageWorkerConfig,"","EnvironmentVariable FUNCTIONS_WORKER_RUNTIME: python",4.27.5.21554,2024-02-23T18:21:57.9930990Z,,"",,7719dbaf-0319-45f8-a0be-6dacebbe12c4,,WSL,,,,
MS_FUNCTION_LOGS 5,,,,,Host.LanguageWorkerConfig,"","EnvironmentVariable FUNCTIONS_WORKER_RUNTIME_VERSION: 3.10",4.27.5.21554,2024-02-23T18:21:57.9931523Z,,"",,7719dbaf-0319-45f8-a0be-6dacebbe12c4,,WSL,,,,
MS_FUNCTION_LOGS 5,,,,,Host.LanguageWorkerConfig,"","Added WorkerConfig for language: python",4.27.5.21554,2024-02-23T18:21:57.9932030Z,,"",,7719dbaf-0319-45f8-a0be-6dacebbe12c4,,WSL,,,,
MS_FUNCTION_LOGS 5,,,,,Host.LanguageWorkerConfig,"","Found worker config: /usr/lib/azure-functions-core-tools-4/workers/node/worker.config.json",4.27.5.21554,2024-02-23T18:21:57.9932423Z,,"",,7719dbaf-0319-45f8-a0be-6dacebbe12c4,,WSL,,,,
MS_FUNCTION_LOGS 5,,,,,Host.LanguageWorkerConfig,"","EnvironmentVariable FUNCTIONS_WORKER_RUNTIME: python",4.27.5.21554,2024-02-23T18:21:57.9933990Z,,"",,7719dbaf-0319-45f8-a0be-6dacebbe12c4,,WSL,,,,
MS_FUNCTION_LOGS 4,,,,,Host.LanguageWorkerConfig,"","FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language: node",4.27.5.21554,2024-02-23T18:21:57.9934933Z,,"",,7719dbaf-0319-45f8-a0be-6dacebbe12c4,,WSL,,,,
[2024-02-23T18:21:57.993Z] FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language: nodeMS_FUNCTION_AZURE_MONITOR_EVENT 4,localhost:7071,Microsoft.Web/sites/functions/log,FunctionAppLogs,,"{'appName':'','roleInstance':'wsl','message':'FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language: node','category':'Host.LanguageWorkerConfig','hostVersion':'4.27.5.21554','hostInstanceId':'7719dbaf-0319-45f8-a0be-6dacebbe12c4','level':'Information','levelId':2,'processId':2651}",WSL,,02/23/2024 18:21:57

...

1

There are 1 answers

0
Vivek Vaibhav Shandilya On

Instead of modifying launch.json with the command: func host start --verbose.

  • Make sure to run the command directly.

  • Make sure you are using the latest version of azure function core tools.

  • Make sure to create a virtual environment using the following commands:

python -m venv .venv
source .venv/bin/activate 

For Refence check this document.

  • Make sure to select an interpreter

I created function using the following commands:

func init --python # OR  func init --worker-runtime python
func new #select trigger and name as per requirement 

My code : function_app.py:

import azure.functions as func
import datetime
import json
import logging

app = func.FunctionApp()


@app.route(route="http_trigger", auth_level=func.AuthLevel.ANONYMOUS)
def http_trigger(req: func.HttpRequest) -> func.HttpResponse:
    logging.info('Python HTTP trigger function processed a request.')

    name = req.params.get('name')
    if not name:
        try:
            req_body = req.get_json()
        except ValueError:
            pass
        else:
            name = req_body.get('name')

    if name:
        return func.HttpResponse(f"Hello, {name}. This HTTP triggered function executed successfully.")
    else:
        return func.HttpResponse(
             "This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response.",
             status_code=200
        )

host.json:

{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request"
      }
    }
  },
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[4.*, 5.0.0)"
  }
}

OUTPUT:

I run the command directly: func host start --verbose

This worked for me.

I am using ubuntu 22.04.

(.venv) vivek@DESKTOP-NL8JDJD:~/linux_vscode_folder/python$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.3 LTS
Release:        22.04
Codename:       jammy

(.venv) vivek@DESKTOP-NL8JDJD:~/linux_vscode_folder/python$ func host start --verbose
Found Python version 3.10.12 (python3).

                  %%%%%%
                 %%%%%%
            @   %%%%%%    @
          @@   %%%%%%      @@
       @@@    %%%%%%%%%%%    @@@
     @@      %%%%%%%%%%        @@
       @@         %%%%       @@
         @@      %%%       @@
           @@    %%      @@
                %%
                %


Azure Functions Core Tools
Core Tools Version:       4.0.5530 Commit hash: N/A +c8883e7f3c06e2b424fbac033806c19d8d91418c (64-bit)
Function Runtime Version: 4.28.5.21962

[2024-02-24T07:15:04.670Z] Building host: version spec: , startup suppressed: 'False', configuration suppressed: 'False', startup operation id: '85c52006-7138-45c7-b7d8-2b1d89dad5b0'
[2024-02-24T07:15:04.676Z] Reading host configuration file '/home/vivek/linux_vscode_folder/python/host.json'
[2024-02-24T07:15:04.677Z] Host configuration file read:
[2024-02-24T07:15:04.677Z] {
[2024-02-24T07:15:04.677Z]   "version": "2.0",
[2024-02-24T07:15:04.678Z]   "logging": {
[2024-02-24T07:15:04.678Z]     "applicationInsights": {
[2024-02-24T07:15:04.678Z]       "samplingSettings": {
[2024-02-24T07:15:04.678Z]         "isEnabled": true,
[2024-02-24T07:15:04.678Z]         "excludedTypes": "Request"
[2024-02-24T07:15:04.678Z]       }
[2024-02-24T07:15:04.678Z]     }
[2024-02-24T07:15:04.678Z]   },
[2024-02-24T07:15:04.678Z]   "extensionBundle": {
[2024-02-24T07:15:04.678Z]     "id": "Microsoft.Azure.Functions.ExtensionBundle",
[2024-02-24T07:15:04.678Z]     "version": "[4.*, 5.0.0)"
[2024-02-24T07:15:04.678Z]   }
[2024-02-24T07:15:04.678Z] }
[2024-02-24T07:15:04.714Z] FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language: node
[2024-02-24T07:15:04.737Z] FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language: java
[2024-02-24T07:15:04.738Z] FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language: powershell
[2024-02-24T07:15:04.743Z] Looking for extension bundle Microsoft.Azure.Functions.ExtensionBundle at /home/vivek/.azure-functions-core-tools/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle
[2024-02-24T07:15:04.744Z] Found a matching extension bundle at /home/vivek/.azure-functions-core-tools/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/4.12.0
[2024-02-24T07:15:04.761Z] Loading functions metadata
[2024-02-24T07:15:04.762Z] Worker indexing is enabled
[2024-02-24T07:15:04.770Z] Fetching metadata for workerRuntime: python
[2024-02-24T07:15:04.771Z] Reading functions metadata (Worker)
[2024-02-24T07:15:04.898Z]  INFO: Starting Azure Functions Python Worker.
[2024-02-24T07:15:04.898Z]  INFO: Worker ID: 68bcb28e-a859-4cea-aa49-07d933fe1306, Request ID: e74a2d09-d4a8-4c53-ae93-06629c45d733, Host Address: 127.0.0.1:46245
[2024-02-24T07:15:05.017Z]  INFO: Using allowed directories for shared memory: ['/dev/shm'] from App Setting: FUNCTIONS_UNIX_SHARED_MEMORY_DIRECTORIES
[2024-02-24T07:15:05.060Z]  INFO: Successfully opened gRPC channel to 127.0.0.1:46245 
[2024-02-24T07:15:05.061Z]  INFO: Detaching console logging.
[2024-02-24T07:15:05.161Z] Switched to gRPC logging.
[2024-02-24T07:15:05.188Z] Received WorkerInitRequest, python version 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0], worker version 4.23.0, request ID e74a2d09-d4a8-4c53-ae93-06629c45d733.App Settings state: PYTHON_THREADPOOL_THREAD_COUNT: 1000 PYTHON_ENABLE_WORKER_EXTENSIONS: False . To enable debug level logging, please refer to https://aka.ms/python-enable-debug-logging
[2024-02-24T07:15:05.188Z] Customer packages not in sys path.
[2024-02-24T07:15:05.423Z] Received WorkerMetadataRequest, request ID e74a2d09-d4a8-4c53-ae93-06629c45d733, directory: /home/vivek/linux_vscode_folder/python
[2024-02-24T07:15:05.425Z] Indexed function app and found 1 functions
[2024-02-24T07:15:05.425Z] Successfully processed FunctionMetadataRequest for functions: Function Name: http_trigger, Function Binding: [('httpTrigger', 'req'), ('http', '$return')]
[2024-02-24T07:15:05.452Z] 1 functions found (Worker)
[2024-02-24T07:15:05.466Z] 1 functions loaded
[2024-02-24T07:15:05.468Z] Looking for extension bundle Microsoft.Azure.Functions.ExtensionBundle at /home/vivek/.azure-functions-core-tools/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle
[2024-02-24T07:15:05.468Z] Found a matching extension bundle at /home/vivek/.azure-functions-core-tools/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/4.12.0
[2024-02-24T07:15:05.468Z] Fetching information on versions of extension bundle Microsoft.Azure.Functions.ExtensionBundle available on https://functionscdn.azureedge.net/public/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/index.json
[2024-02-24T07:15:05.637Z] Skipping bundle download since it already exists at path /home/vivek/.azure-functions-core-tools/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/4.12.0
[2024-02-24T07:15:05.646Z] Loading extension bundle from /home/vivek/.azure-functions-core-tools/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/4.12.0/bin
[2024-02-24T07:15:05.646Z] Script Startup resetting load context with base path: '/home/vivek/.azure-functions-core-tools/Functions/ExtensionBundles/Microsoft.Azure.Functions.ExtensionBundle/4.12.0/bin'.
[2024-02-24T07:15:05.669Z] Reading host configuration file '/home/vivek/linux_vscode_folder/python/host.json'
[2024-02-24T07:15:05.669Z] Host configuration file read:
[2024-02-24T07:15:05.669Z] {
[2024-02-24T07:15:05.669Z]   "version": "2.0",
[2024-02-24T07:15:05.669Z]   "logging": {
[2024-02-24T07:15:05.670Z]     "applicationInsights": {
[2024-02-24T07:15:05.670Z]       "samplingSettings": {
[2024-02-24T07:15:05.670Z]         "isEnabled": true,
[2024-02-24T07:15:05.670Z]         "excludedTypes": "Request"
[2024-02-24T07:15:05.670Z]       }
[2024-02-24T07:15:05.670Z]     }
[2024-02-24T07:15:05.670Z]   },
[2024-02-24T07:15:05.670Z]   "extensionBundle": {
[2024-02-24T07:15:05.671Z]     "id": "Microsoft.Azure.Functions.ExtensionBundle",
[2024-02-24T07:15:05.671Z]     "version": "[4.*, 5.0.0)"
[2024-02-24T07:15:05.671Z]   }
[2024-02-24T07:15:05.671Z] }
[2024-02-24T07:15:06.000Z] FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language: node
[2024-02-24T07:15:06.001Z] FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language: java
[2024-02-24T07:15:06.001Z] FUNCTIONS_WORKER_RUNTIME set to python. Skipping WorkerConfig for language: powershell
[2024-02-24T07:15:06.118Z] Initializing Warmup Extension.
[2024-02-24T07:15:06.190Z] Initializing Host. OperationId: '85c52006-7138-45c7-b7d8-2b1d89dad5b0'.
[2024-02-24T07:15:06.201Z] Host initialization: ConsecutiveErrors=0, StartupCount=1, OperationId=85c52006-7138-45c7-b7d8-2b1d89dad5b0
[2024-02-24T07:15:06.266Z] LoggerFilterOptions
[2024-02-24T07:15:06.266Z] {
[2024-02-24T07:15:06.266Z]   "MinLevel": "None",
[2024-02-24T07:15:06.266Z]   "Rules": [
[2024-02-24T07:15:06.267Z]     {
[2024-02-24T07:15:06.267Z]       "ProviderName": null,
[2024-02-24T07:15:06.267Z]       "CategoryName": null,
[2024-02-24T07:15:06.267Z]       "LogLevel": null,
[2024-02-24T07:15:06.268Z]       "Filter": "<AddFilter>b__0"
[2024-02-24T07:15:06.268Z]     },
[2024-02-24T07:15:06.268Z]     {
[2024-02-24T07:15:06.268Z]       "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2024-02-24T07:15:06.268Z]       "CategoryName": null,
[2024-02-24T07:15:06.268Z]       "LogLevel": "None",
[2024-02-24T07:15:06.268Z]       "Filter": null
[2024-02-24T07:15:06.268Z]     },
[2024-02-24T07:15:06.269Z]     {
[2024-02-24T07:15:06.269Z]       "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2024-02-24T07:15:06.269Z]       "CategoryName": null,
[2024-02-24T07:15:06.269Z]       "LogLevel": null,
[2024-02-24T07:15:06.269Z]       "Filter": "<AddFilter>b__0"
[2024-02-24T07:15:06.269Z]     },
[2024-02-24T07:15:06.270Z]     {
[2024-02-24T07:15:06.270Z]       "ProviderName": "Azure.Functions.Cli.Diagnostics.ColoredConsoleLoggerProvider",
[2024-02-24T07:15:06.270Z]       "CategoryName": null,
[2024-02-24T07:15:06.270Z]       "LogLevel": null,
[2024-02-24T07:15:06.270Z]       "Filter": "<AddFilter>b__0"
[2024-02-24T07:15:06.270Z]     }
[2024-02-24T07:15:06.270Z]   ]
[2024-02-24T07:15:06.270Z] }
[2024-02-24T07:15:06.271Z] LoggerFilterOptions
[2024-02-24T07:15:06.271Z] {
[2024-02-24T07:15:06.271Z]   "MinLevel": "None",
[2024-02-24T07:15:06.271Z]   "Rules": [
[2024-02-24T07:15:06.271Z]     {
[2024-02-24T07:15:06.271Z]       "ProviderName": null,
[2024-02-24T07:15:06.271Z]       "CategoryName": null,
[2024-02-24T07:15:06.271Z]       "LogLevel": null,
[2024-02-24T07:15:06.272Z]       "Filter": "<AddFilter>b__0"
[2024-02-24T07:15:06.272Z]     },
[2024-02-24T07:15:06.272Z]     {
[2024-02-24T07:15:06.272Z]       "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2024-02-24T07:15:06.272Z]       "CategoryName": null,
[2024-02-24T07:15:06.272Z]       "LogLevel": "None",
[2024-02-24T07:15:06.272Z]       "Filter": null
[2024-02-24T07:15:06.272Z]     },
[2024-02-24T07:15:06.273Z]     {
[2024-02-24T07:15:06.273Z]       "ProviderName": "Microsoft.Azure.WebJobs.Script.WebHost.Diagnostics.SystemLoggerProvider",
[2024-02-24T07:15:06.273Z]       "CategoryName": null,
[2024-02-24T07:15:06.273Z]       "LogLevel": null,
[2024-02-24T07:15:06.273Z]       "Filter": "<AddFilter>b__0"
[2024-02-24T07:15:06.274Z]     },
[2024-02-24T07:15:06.274Z]     {
[2024-02-24T07:15:06.274Z]       "ProviderName": "Azure.Functions.Cli.Diagnostics.ColoredConsoleLoggerProvider",
[2024-02-24T07:15:06.274Z]       "CategoryName": null,
[2024-02-24T07:15:06.274Z]       "LogLevel": null,
[2024-02-24T07:15:06.274Z]       "Filter": "<AddFilter>b__0"
[2024-02-24T07:15:06.275Z]     }
[2024-02-24T07:15:06.275Z]   ]
[2024-02-24T07:15:06.275Z] }
[2024-02-24T07:15:06.276Z] ConcurrencyOptions
[2024-02-24T07:15:06.276Z] {
[2024-02-24T07:15:06.276Z]   "DynamicConcurrencyEnabled": false,
[2024-02-24T07:15:06.277Z]   "MaximumFunctionConcurrency": 500,
[2024-02-24T07:15:06.277Z]   "CPUThreshold": 0.8,
[2024-02-24T07:15:06.277Z]   "SnapshotPersistenceEnabled": true
[2024-02-24T07:15:06.277Z] }
[2024-02-24T07:15:06.278Z] FunctionResultAggregatorOptions
[2024-02-24T07:15:06.278Z] {
[2024-02-24T07:15:06.278Z]   "BatchSize": 1000,
[2024-02-24T07:15:06.278Z]   "FlushTimeout": "00:00:30",
[2024-02-24T07:15:06.278Z]   "IsEnabled": true
[2024-02-24T07:15:06.279Z] }
[2024-02-24T07:15:06.279Z] SingletonOptions
[2024-02-24T07:15:06.279Z] {
[2024-02-24T07:15:06.279Z]   "LockPeriod": "00:00:15",
[2024-02-24T07:15:06.279Z]   "ListenerLockPeriod": "00:00:15",
[2024-02-24T07:15:06.279Z]   "LockAcquisitionTimeout": "10675199.02:48:05.4775807",
[2024-02-24T07:15:06.279Z]   "LockAcquisitionPollingInterval": "00:00:05",
[2024-02-24T07:15:06.280Z]   "ListenerLockRecoveryPollingInterval": "00:01:00"
[2024-02-24T07:15:06.280Z] }
[2024-02-24T07:15:06.280Z] ScaleOptions
[2024-02-24T07:15:06.280Z] {
[2024-02-24T07:15:06.280Z]   "ScaleMetricsMaxAge": "00:02:00",
[2024-02-24T07:15:06.280Z]   "ScaleMetricsSampleInterval": "00:00:10",
[2024-02-24T07:15:06.280Z]   "MetricsPurgeEnabled": true,
[2024-02-24T07:15:06.280Z]   "IsTargetScalingEnabled": true,
[2024-02-24T07:15:06.281Z]   "IsRuntimeScalingEnabled": false
[2024-02-24T07:15:06.281Z] }
[2024-02-24T07:15:06.282Z] Starting JobHost
[2024-02-24T07:15:06.290Z] Starting Host (HostId=desktopnl8jdjd-1012982863, InstanceId=3380e2e1-0f73-4c9e-8106-78e84e341b13, Version=4.28.5.21962, ProcessId=22292, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, FunctionsExtensionVersion=(null))
[2024-02-24T07:15:06.328Z] Loading functions metadata
[2024-02-24T07:15:06.332Z] Worker indexing is enabled
[2024-02-24T07:15:06.332Z] Fetching metadata for workerRuntime: python
[2024-02-24T07:15:06.332Z] Reading functions metadata (Worker)
[2024-02-24T07:15:06.372Z] Reading functions metadata (Custom)
[2024-02-24T07:15:06.401Z] 1 functions found (Custom)
[2024-02-24T07:15:06.416Z] 1 functions loaded
[2024-02-24T07:15:06.501Z] Generating 1 job function(s)
[2024-02-24T07:15:06.503Z] Worker process started and initialized.
[2024-02-24T07:15:06.504Z] Received WorkerLoadRequest, request ID e74a2d09-d4a8-4c53-ae93-06629c45d733, function_id: 7f733524-7d0f-5034-879a-38f16d5d1306,function_name: http_trigger,
[2024-02-24T07:15:06.504Z] Successfully processed FunctionLoadRequest, request ID: e74a2d09-d4a8-4c53-ae93-06629c45d733, function ID: 7f733524-7d0f-5034-879a-38f16d5d1306,function Name: http_trigger,programming model: V1
[2024-02-24T07:15:06.577Z] Found the following functions:
[2024-02-24T07:15:06.577Z] Host.Functions.http_trigger
[2024-02-24T07:15:06.577Z] 
[2024-02-24T07:15:06.589Z] HttpOptions
[2024-02-24T07:15:06.589Z] {
[2024-02-24T07:15:06.589Z]   "DynamicThrottlesEnabled": false,
[2024-02-24T07:15:06.589Z]   "EnableChunkedRequestBinding": false,
[2024-02-24T07:15:06.589Z]   "MaxConcurrentRequests": -1,
[2024-02-24T07:15:06.590Z]   "MaxOutstandingRequests": -1,
[2024-02-24T07:15:06.590Z]   "RoutePrefix": "api"
[2024-02-24T07:15:06.590Z] Initializing function HTTP routes
[2024-02-24T07:15:06.590Z] }
[2024-02-24T07:15:06.590Z] Mapped function route 'api/http_trigger' [all] to 'http_trigger'
[2024-02-24T07:15:06.591Z] 
[2024-02-24T07:15:06.605Z] Host initialized (298ms)
[2024-02-24T07:15:06.608Z] Host started (315ms)
[2024-02-24T07:15:06.608Z] Job host started

Functions:

        http_trigger:  http://localhost:7071/api/http_trigger

[2024-02-24T07:15:11.262Z] Host lock lease acquired by instance ID '000000000000000000000000116B5F66'.
[2024-02-24T07:15:18.274Z] Executing HTTP request: {
[2024-02-24T07:15:18.274Z]   "requestId": "aba92772-df45-45a2-9ffb-0259bf85ed92",
[2024-02-24T07:15:18.274Z]   "method": "GET",
[2024-02-24T07:15:18.274Z]   "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0",
[2024-02-24T07:15:18.274Z]   "uri": "/api/http_trigger"
[2024-02-24T07:15:18.274Z] }
[2024-02-24T07:15:18.517Z] Executing 'Functions.http_trigger' (Reason='This function was programmatically called via the host APIs.', Id=5c921bc8-30bb-404a-a6c8-aa36496fec8c)
[2024-02-24T07:15:18.587Z] Received FunctionInvocationRequest, request ID: e74a2d09-d4a8-4c53-ae93-06629c45d733, function ID: 7f733524-7d0f-5034-879a-38f16d5d1306, function name: http_trigger, invocation ID: 5c921bc8-30bb-404a-a6c8-aa36496fec8c, function type: sync, sync threadpool max workers: 1000
[2024-02-24T07:15:18.599Z] Python HTTP trigger function processed a request.
[2024-02-24T07:15:18.693Z] Executed 'Functions.http_trigger' (Succeeded, Id=5c921bc8-30bb-404a-a6c8-aa36496fec8c, Duration=210ms)
[2024-02-24T07:15:18.738Z] Executed HTTP request: {
[2024-02-24T07:15:18.738Z]   "requestId": "aba92772-df45-45a2-9ffb-0259bf85ed92",
[2024-02-24T07:15:18.738Z]   "identities": "",
[2024-02-24T07:15:18.738Z]   "status": "200",
[2024-02-24T07:15:18.738Z]   "duration": "466"
[2024-02-24T07:15:18.738Z] }