Reputation: 396
I am getting this error from a QueueTrigger function that also needs a CloudQueue binding.
Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexingException : Error indexing method 'QueueInstancesToImport.Run' ---> System.InvalidOperationException : Can't bind Queue to type 'Microsoft.WindowsAzure.Storage.Queue.CloudQueue'.
According to the docs CloudQueue should be valid.
https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-queue
Other potential solutions I have found don't match exactly or don't help.
My code
public static class QueueFormInstancesToImport
{
[FunctionName("QueueFormInstancesToImport")]
public static async Task Run(
[QueueTrigger("import-queue")]string message,
[Queue("import-queue")]CloudQueue queue,
TraceWriter traceWriter,
ExecutionContext context)
{
// Body of function
...
}
}
Upvotes: 2
Views: 2365
Reputation: 3169
This is very likely a nuget package conflict. The assembly version that your 'CloudQueue' parameter is coming from is a different version of the stroage library than what's being used by the underlying Function runtime. You can F12 on the CloudQueue definition to see the full assembly version that it's binding against.
You very likely have add an extra reference to the Azure Storage SDK. Remove the extra reference and just use the reference from the Azure Functions template.
Upvotes: 4