How do we add the storage table data in cosmos db trigger in isolated worker process model in Azure function .net 8

lakshmi 671 Reputation points
2024-06-15T17:45:51.7266667+00:00

Hi Team,

Below is the current azure function cosmos db trigger configuration,

[FunctionName("log-available-agents")]
public async Task Run([CosmosDBTrigger(
    databaseName: "%CosmosDatabaseId%",
    collectionName: "agentData",
    ConnectionStringSetting = "CosmosDbConnection",
    LeaseCollectionName = "leases",
    CreateLeaseCollectionIfNotExists = true)] IReadOnlyList<Document> input,
    ILogger logger,
    [Table("agentDataLogs", Connection = "AzureWebJobsStorage")] IAsyncCollector<agentDataLogEntity> table,
    [CosmosDB(
    databaseName: "%CosmosDatabaseId%",
    collectionName: "agentData",
    ConnectionStringSetting = "CosmosDbConnection")]DocumentClient client) 

We are working on upgrading the azure function to isolated process model with .net 8 version.

We were able to get the cosmos db table entities while triggering, but can implement the same Table attribute to store the storage table names to store the logs.

In process model, we have the option to directly get the table details using IAsyncCollector<agentDataLogEntity> table, and can directly use the 'table' to add the data to storage table log. But once upgraded to process model, we are explictity creating a table client and additng th value.

We have gone though the Table output properties of isolated process model, but in our scenario we have triggers with multiple table output. how to handle those scenarios

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,693 questions
0 comments No comments
{count} votes