Hi ,
Please find my code below,
when I am trying to run this on local then it giving below error message on the console,
[FunctionName("Function1")]
public async Task Run([ServiceBusTrigger("%AuditScanTopic%","%AuditSubscriptionName%",
Connection = "AuditConnectionString")]Message enqueueMessage, MessageReceiver messageReceiver,
string lockToken, IAsyncCollector<Rawmessage> cosmodbCollector,
ILogger log)
{
log.LogInformation($"C# ServiceBus topic trigger function processed message: {lockToken}");
await messageReceiver.CompleteAsync(lockToken);
}
this is NuGet package reference,
<ItemGroup>
<PackageReference Include="Azure.Messaging.ServiceBus" Version="7.2.1" />
<PackageReference Include="Microsoft.Azure.Cosmos.Table" Version="1.0.8" />
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.1.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.CosmosDB" Version="3.0.10" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ServiceBus" Version="4.3.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="4.0.4" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.11" />
<PackageReference Include="WindowsAzure.Storage" Version="9.3.3" />
</ItemGroup>
error message-
Microsoft.Azure.WebJobs.Host: Error indexing method 'Function1'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'cosmodbCollector' 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.).
Please suggest.