1

I am using a QueueTrigger with the following signature:

public static void Run([QueueTrigger("tester")]string myQueueItem,[Blob("local/{queueTrigger}")]ICloudBlob myBlob,TraceWriter log)

The binding in function.json being generated is:

    "bindings": [
    {
      "type": "queueTrigger",
      "queueName": "tester",
      "connection": "AzureWebJobsStorage",
      "name": "myQueueItem"
    }
  ],

This doesn't work because it won't bind the appropriate blob as an in binding. If I manually edit the function.json it binds properly as it should:

"bindings": [
{
  "type": "queueTrigger",
  "queueName": "tester",
  "connection": "AzureWebJobsStorage",
  "name": "myQueueItem"
},
{
  "name": "myBlob",
  "type": "blob",
  "path": "local/{queueTrigger}",
  "direction": "in",
  "connection": "AzureWebJobsStorage"
}],

My question is how can I indicate that input binding in the C# code so the function.json gets generated appropriately? I know for output bindings you can decorate it with the out parameter, but what for the in? Is this a bug or am I missing something?

2
  • what version of the cli are you using? also which version of Microsoft.NET.Sdk.Functions are you using? you can find that in your csproj Commented Aug 30, 2017 at 16:38
  • I'm using Functions 1.0.0 and doing via Visual Studio tooling Commented Aug 30, 2017 at 18:25

1 Answer 1

1

Is this authored via the Function VS tooling? That only generates a function.json describing the trigger [1]. The other bindings are read directly from the C# attributes, just like with WebJobs SDK.

The function.json that was autogenerated by the tool should also have a "configurationSource" : "attributes" property. That's what tells the Functions Runtime to read the bindings from the attributes. If that's missing, then it likely means you have pre-release tooling and need to update your CLI and Microsoft.NET.Sdk.Functions package.

Can you confirm that property is set?

Also, your "Run" method should have a [FunctionName] attribute on it.

[1] This was changed from the pre-release builds of tooling, see https://github.com/Azure/azure-webjobs-sdk-script/issues/1508

Sign up to request clarification or add additional context in comments.

3 Comments

Yes I am using the attributes as you can see in the question and it has the configuration source. I also have a FunctionName attribute, I just omitted those things to show what was relevant. I'm using VS 15.3.2. Just updated the other day. To be clear, if I manually add the bindings to function.json in the bin it works as expected. If left to VS it does not work
When it doesn't work - are you running it locally (via the CLI) or in Azure? If you're running in Azure on a version that's locked back to an older version (before the #1508 fix), then you'd see this failure.
I am running it locally. I managed to get it functioning properly by doing a repair on VS and re-installing the Functions tooling.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.