I have a function, triggered off a service bus. The bus contains data from several sources, which I want to process and write to a storage table. I can't guarantee there won't be duplicate entries in the bus, but require unique entries in the table. I've figured out I can access an IAsyncCollector of my object type, but this doesn't have a way to search for objects that already exist, or to update them. Here's my current function code:
[FunctionName(nameof(Run))]
public async Task Run([Microsoft.Azure.WebJobs.ServiceBusTrigger("myBus", Connection = "myCon")] ServiceBusReceivedMessage message,
[Table("Widgets", Connection = "AzureWebJobsStorage")] IAsyncCollector<Widgets> widgetsTable,
ILogger log)
{
log.LogInformation($"queue trigger function processed message");
}
How do I access the table in a way that allows me to find/update objects?
You cannot use the output binding for that:
(source)
So you need to remove the output binding and leverage the table SDK directly.