microsoft / vscode-azurefunctions

Azure Functions extension for VS Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions
MIT License
291 stars 132 forks source link

The blob size is "None bytes" in the output log after executing EventGrid-based blob trigger function #4051

Open v-xinda opened 5 months ago

v-xinda commented 5 months ago

OS: All Build Version: vscode-azurefunctions-1.13.5-alpha.0-4 Regression: Not a Regression

Repro Steps:

  1. Create a Python V1 project with Azure Blob Storage trigger template and open in VS Code.
  2. Add the follow contexts in the Launch.json file.
    "scriptFile": "__init__.py",
    "bindings": [
    {
      "name": "myblob",
      "type": "blobTrigger",
      "direction": "in",
      "path": "samples-workitems/{name}",
      "source": "EventGrid",
      "connection": "<NAMED_STORAGE_CONNECTION>"
    }
    ]
  3. F5.
  4. Navigate to "Workspace" view -> Expand "Local Project" -> Expand "Function" -> Right click the function -> Execute Function Now... -> Enter the blob path (The blob is not empty).
  5. Check the output log.

Expect: Show the correct blob size in the output log. image

Actual: The blob size is "None bytes" in the output log. image

More Info:

  1. This issue doesn't reproduce for the JavaScript/TypeScript model V3 project.
  2. The launch.json contexts as below:

    
    {
    "version": "0.2.0",
    "configurations": [
    {
      "name": "Attach to Python Functions",
      "type": "python",
      "request": "attach",
      "port": 9091,
      "preLaunchTask": "func: host start"
    }
    ],
    
    "scriptFile": "__init__.py",
    "bindings": [
      {
        "name": "myblob",
        "type": "blobTrigger",
        "direction": "in",
        "path": "samples-workitems/{name}",
        "source": "EventGrid",
        "connection": "<NAMED_STORAGE_CONNECTION>"
      }
    ]

}

3. The host.json contexts as below:

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

hossam-nasr commented 5 months ago

This repros with both Python V1 & V2, with both EventGrid-based and normal blob triggers, and even if the function is executed outside VSCode using Core Tools. This isn't a VSCode extension issue, but rather a Functions Python worker or templates issue. Closing this in favor of https://github.com/Azure/azure-functions-python-worker/issues/1453