2
votes

I am currently using python in azure functions to create a timer trigger that aggregates data from blob storage, and puts the result in cosmosDB.

My problem is as follows: When I use a specific file in the path binding the functions runs as expected. Whenever I change it (so as to take all blobs in the container) I get the following error:

 Microsoft.Azure.WebJobs.Host: No value for named parameter 'test'.

Below is my function.json bindings

{
  "bindings": [
    {
      "name": "blobTrigger",
      "type": "timerTrigger",
      "direction": "in",
      "schedule": "0 0 * * * *",
      "connnection": "AzureWebJobsStorage",
      "path": "blob/{test}"
     },
     {
       "type": "blob",
       "name": "inputBlob",
       "path": "blob/{test}",
       "connection": "AzureWebJobsStorage",
       "direction": "in"
     },
     {
       "type": "documentDB",
       "name": "outputDocument",
       "databaseName": "database1",
       "collectionName": "functioncollection",
       "createIfNotExists": false,
       "connection": "development_DOCUMENTDB",
       "direction": "out"
      }
    ],
    "disabled": false
}

Unsure if connection to storage is supposed to be in the trigger binding also, but when ive tried without it i still get the same error.

Do any of you have any idea how to solve this?

Thanks.

1

1 Answers

1
votes

This is not a legal syntax for timer trigger / blob input binding. When you set blob path to blob/{test}, that means you are binding blob path to a piece of information from your function's trigger. E.g. it could be used to bind to a property of queue messages.

In your case, the trigger is timer, so it has no information with it that could be used as parameter for blob input binding.

You can't really bind your function to ALL blobs in a container. If you need to access all blobs at once, you might have to do it manually (without dedicated binding, just by using SDK). Alternatively, create a function which will be triggered for each added/changed blob - if you can operate on one blob at a time.