Logic App将数据从Cosmosdb推入CRM并执行更新 [英] Logic App to push data from Cosmosdb into CRM and perform an update

查看:113
本文介绍了Logic App将数据从Cosmosdb推入CRM并执行更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个逻辑应用程序,目的是从cosmosdb中的容器中提取数据(带有查询),遍历结果,然后将这些数据推送到CRM(或Common Data Service)中.将数据推送到CRM时,将生成一个ID.然后,我希望使用此新ID更新cosmosdb.这是我到目前为止的内容:

I have created a logic app with the goal of pulling data from a container within cosmosdb (with a query), looping over the results and then pushing this data into CRM (or Common Data Service). When the data is pushed to CRM, an ID will be generated. I wish to then update cosmosdb with this new ID. Here is what I have so far:

下一步是在cosmosdb数据库中查询数据,然后选择所有长度大于15的IDS.(这表明该ID尚未在CRM数据库中)

This next step is querying for the data within our cosmosdb database and selecting all IDS with a length that is greater than 15. (This tells us that the ID is not yet within the CRM database)

然后,我们遍历结果并将其推送到CRM(Dynamics365或Common Data Service)

Then we loop over the results and push this into CRM (Dynamics365 or the Common Data Service)

困境:此过程的第一部分似乎是正确的,但是,我想确保自己在正确的方向上前进.此外,一旦将数据成功推送到CRM,CRM就会为每条记录自动生成一个ID.然后,如何使用新生成的ID更新cosmosDB?

Dilemma: The first part of this process appears to be correct, however, I want to make sure that I am on the right track with this. Furthermore, once the data is successfully pushed to CRM, CRM automatically generates an ID for each record. How would I then update cosmosDB with the newly generated IDs?

任何建议都值得赞赏 谢谢

Any suggestion is appreciated Thanks

推荐答案

在此方法中,使用length(c.id) > 15进行此查询时,我在您的方法中看到一个红色标记.这不是我要做的.我不知道您的数据库将有多大,但是通常无法很好地执行大量的跨分区查询,尤其是在数据库将保持增长的情况下.

I see a red flag in your approach here with this query with length(c.id) > 15. This is not something I would do. I don't know how big your database is going to be but generally not very performant to do high volumes of cross partition queries, especially if the database is going to keep growing.

Cosmos DB已经提供了出色的流传输功能,因此,我将不使用批处理Feed,而是使用Change Feed来完成此任务,而可以使用它来完成您在Logic App中所做的一切.这样可能会更好地控制流程,并可能让您从CRM应用程序中获取ID并重新插入Cosmos DB中.

Cosmos DB already provides an awesome streaming capability so rather than doing this in a batch I would use Change Feed and use that to accomplish whatever your doing here in your Logic App. This will likely give you better control of the process and likely allow you to get the id back out of your CRM app to insert back into Cosmos DB.

由于您将写回Cosmos DB,因此需要一个标志来在项目更新时忽略更改Feed中的更新.

Because you will be writing back to Cosmos DB, you will need a flag to ignore the update in Change Feed when the item is updated.

这篇关于Logic App将数据从Cosmosdb推入CRM并执行更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆