'How to debug a blob triggered azure function on VScode without it re-running on all the existing blobs

Note: In the question below, I am not deploying the function, I just want to debug the function and see some values to confirm my code.

I have an azure function that I test locally on VScode (azure extension). This function is blob triggered i.e. triggered an an image is uplaoded to ac ertain blob container (say c). I have also linked my blob storage my vscode. The storage container c has a lot of images already (200+). When I change anything in my azure function, I want to debug it using a single new image upload. But as soon as I hit debug, it shows a lot of blobs triggered (please see snapshot). Sometimes I have to wait a long time as it seems to trigger all the blobs but I want that function is only triggered by the new upload I do.

Can someone help me with what I am doing wrong?

Thank you.

Edit:

My blob trigger/azure function is way too long so I will just post on how it triggers

def main(myblob: func.InputStream, doc: func.Out[func.Document]):
    logging.info(f"Python blob trigger function processed blob \n"
                 f"Name: {myblob.name}\n"
                 f"Blob Size: {myblob.length} bytes")

    blob_val = myblob.read()
    .
    .
    .

and host.json:

{
  "version": "2.0",
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[2.*, 3.0.0)"
  }
}

Please let me know if this is insufficient. In short, my function is triggered when it sees a new image (with a certain suffix), does some processing on the image and uploads the computed metadata somewhere.

enter image description here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source