0
votes

I have a Queue Trigger in Azure function Function, Right now it has method signature as : Run([QueueTrigger("listner")]string myQueueItem, TraceWriter log)

I want to add one more parameter of type CloudQueueMessage. So when i added it. it throws an error like Message ->

(QueueTriggerForFileProcessing) Error: Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.QueueTriggerForFileProcessing'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'msg' to type CloudQueueMessage. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. config.UseServiceBus(), config.UseTimers(), etc.).

Does anyone come across similar requirement ? any workable solution to this?

Thanks in advance

Ravi

1
Works like charm here. Which environment are you using? Visual Studio 15.3 (2017 Preview 2)?Mikhail Shilkov
It compiles fine in VS 2017 v15.3.. but when i publish it to azure i am getting the error message like i mentioned earlier.ravibhat
Also i tried to change datatype to Run([QueueTrigger("listner")] CloudQueueMessage myQueueItem, TraceWriter log), but throws an error in runtime String reference not set to an instance of a stringravibhat
Ah, I thought you were replacing string with CloudQueueMessage. From which line do you get this runtime exception? Could you extend the question with the complete function body (smallest possible repro)?Mikhail Shilkov
There is nothing in my code , you can see the following method definition: Run([QueueTrigger("daflistner")]CloudQueueMessage myQueueItem, TraceWriter log). There something similar issue i can see in GitHub : github.com/Azure/azure-webjobs-sdk-script/issues/1366 . But no answer in that issue. Error what i getting is same error what he mentioned.ravibhat

1 Answers

0
votes

Please ensure you're targeting the same storage package version as what the storage binding currently uses (currently, 7.2.1).

You can use different versions if using those types from within your function (not relying on bindings), but when binding to types from the package, you'll need to use the version expected by the runtime.