Can Stream Analytics Update values in an existing table in Cosmos DB PostgreSQL?

Ben Rad 0 Reputation points


I was wondering if I could update data in Cosmos DB for PostgreSQL table using Stream Analytics.

I receive data through IOTHub and instead of adding rows of data I need to update values in different rows and columns.

It seems that Stream Analytics only insert new data.

If not possible to update data, can I use Azure function and python to update data in PostgreSQL table.



Azure Stream Analytics
Azure Stream Analytics
An Azure real-time analytics service designed for mission-critical workloads.
306 questions
Azure Cosmos DB
Azure Cosmos DB
An Azure NoSQL database service for app development.
1,272 questions
Azure Database for PostgreSQL
{count} votes

1 answer

Sort by: Most helpful
  1. Sedat SALMAN 10,495 Reputation points

    You can use Azure Database for PostgreSQL as an output for data that's relational in nature or for applications that require content to be hosted in a relational database. Azure Stream Analytics jobs write to an existing table in a PostgreSQL database.

    However, you can leverage Azure Functions to handle this. With an Azure Function triggered by Stream Analytics, you can utilize Python to connect to your Cosmos DB with the PostgreSQL API and update your data accordingly.