如何使用 Azure 逻辑应用程序将数据插入 Azure Cosmos DB?

How to insert data into Azure Cosmos DB using Azure Logic apps?

我想将逻辑应用程序 (success/failure) 的结果存储到 Cosmos DB 中的 table 中,以便使用逻辑应用程序进行报告。

我想知道;

  1. 如何创建 Azure Cosmos DB 和 table 来存储 success/failure 消息作为同一逻辑应用程序的最后一步?

提前致谢。

我们可以尝试一些解决方法

方式一:

  • 这样,我们必须需要有一个特定的参数来定义整个逻辑应用程序成功或失败的条件,以便我们可以使用 condition 连接器。

    (NOTE: Here we need to keep in mind that when a connector fails the flow stops till there itself and so we are using this method )

  • 将所需的变量设置为 success/failure。
  • 使用 compose 连接器创建自己的格式。
  • 将组合输出发送到我们在 cosmos DB 中的 table。

以下截图供大家参考

这是输出:


方式二 创建嵌套逻辑应用程序

(注意: 即使在这种情况下,我们也必须记住,如果一个逻辑应用程序中的一个连接器出现故障,它将无法到达下一个逻辑应用程序