I'm new to Azure Function and in my first function I'm using CosmosDB. Under the hood, function is doing its job perfectly but when I open my function in portal I'm getting this error.
Function (LOANGILITY-AZFUNCTION/ProductDetailsFunc) Error: Microsoft.Azure.WebJobs.Host: Error indexing method 'ProductDetailsFunc'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'document' to type IAsyncCollector`1. Make sure the parameter Type is supported by the binding. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
My Function Header Prototype is
public static async Task<HttpResponseMessage> Run(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)]HttpRequestMessage req,
[DocumentDB(
databaseName: "OB",
collectionName: "ProductDetails",
ConnectionStringSetting = "DBConnection")]IAsyncCollector<dynamic> document,
TraceWriter log)
Generated json from my code is
{
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.13",
"configurationSource": "attributes",
"bindings": [
{
"type": "httpTrigger",
"methods": [
"get",
"post"
],
"authLevel": "anonymous",
"name": "req"
}
],
"disabled": false,
"scriptFile": "../bin/Loangility01.dll",
"entryPoint": "Loangility01.ProductDetailsFunc.Run"
}
I also see some other SO questions and they are talking about builder.something
in the code and I'm not working on .Net Core Azure Function, my target Project Framework is 4.6.1
.