简体   繁体   English

是否可以从 stream 分析中调用 cosmos db 触发器?

[英]Is it possible to invoke cosmos db trigger from stream analytics?

I have some devices sending data to Azure iot hub.我有一些设备将数据发送到 Azure 物联网集线器。 I am using stream analytics service to process the data and insert it in cosmos db documentdb.我正在使用 stream 分析服务来处理数据并将其插入 cosmos db documentdb。 I thought about use cosmosdb trigger to update some docs when certain items are created, but I found that triggers are invoke via API or SDK.我想过在创建某些项目时使用 cosmosdb 触发器来更新一些文档,但我发现触发器是通过 API 或 SDK 调用的。 Is it possible to invoke cosmos db trigger from stream analytics?是否可以从 stream 分析中调用 cosmos db 触发器? another way to resolve the problem?解决问题的另一种方法?

There is no trigger in ASA for CosmosDb. ASA 中没有针对 CosmosDb 的触发器。 But how about using Azure Function Trigger for CosmosDB ?但是如何为 CosmosDB 使用 Azure Function 触发器呢? This concept is using CosmosDb Change feed, and it is the easiest way to pick up the changes in your CosmosDb.此概念使用 CosmosDb 更改源,它是获取 CosmosDb 中更改的最简单方法。 Below is one example from the documentation attached in the link above.以下是上述链接中所附文档的一个示例。

#r "Microsoft.Azure.DocumentDB.Core"

using System;
using Microsoft.Azure.Documents;
using System.Collections.Generic;
using Microsoft.Extensions.Logging;

public static void Run(IReadOnlyList<Document> documents, ILogger log)
{
  log.LogInformation("Documents modified " + documents.Count);
  log.LogInformation("First document Id " + documents[0].Id);
}

The alternative is to check on CosmosDB change feed manually and implement a solution that occasionaly takes the changes and does whatever you need.另一种方法是手动检查 CosmosDB 更改源并实施一个解决方案,该解决方案偶尔会进行更改并执行您需要的任何操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 没有数据从 Azure stream 分析推送到 Cosmos DB - No data getting pushed from Azure stream analytics to Cosmos DB Azure Stream Analytics输出到Azure Cosmos DB - Azure Stream Analytics output to Azure Cosmos DB 使用Stream Analytics将数据从IoT中心传输到Cosmos DB会产生分区错误 - Using Stream Analytics to transfer data from IoT Hub to Cosmos DB gives partition error 使用 cosmos db 触发器从 Cosmos db 中检索特定数据 - Retrieve specific data from Cosmos db using cosmos db trigger 将数据推送到 Cosmos DB 时 Azure 流分析作业降级 - Azure Stream Analytics Job degrading while pushing data to cosmos DB Azure Cosmos DB触发器 - Azure cosmos db trigger 是否可以从Azure cosmos db进行httprequest? - Is it possible to make httprequest from Azure cosmos db? 如何使用Cosmos DB触发器从Azure函数中的Azure Cosmos DB中断中恢复 - How to recover from Azure Cosmos DB Outage in Azure Function with Cosmos DB Trigger 使用 Cosmos DB 绑定从 Azure 函数执行 Cosmos DB 服务器端触发器 - Execute a Cosmos DB server-side trigger from an Azure function using Cosmos DB bindings 将集合的TTL设置为ON时,无法通过Azure流分析作业更新Cosmos DB集合 - Unable to Update Cosmos DB collection by Azure Stream Analytics Job when TTL is set as ON for the collection
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM