【问题标题】:Azure Cosmos DB- Trigger Change Feed only for specific values using Azure FunctionsAzure Cosmos DB - 仅针对使用 Azure Functions 的特定值触发更改源
【发布时间】:2020-05-11 11:35:53
【问题描述】:

我们希望在 Cosmos DB 更改源上触发 Azure 函数,但前提是在 cosmos DB 中插入了特定值。

例如。这是我们存储到 cosmos DB 中的 json 示例。

{
    "EventGuid": "3ecab093-564e-4642-9e5c-097ab89a03c9",
    "NotificationType": 11,
    "NotificationTypeDesc": "CardGroupChanged",
    "UserUUId": "06db4897-e63a-4be7-bd24-c5b59749a5b3",
    "GroupName": null,
    "Payer": "CZ00001927",
    "Account": "CZ00001927",
    "Status": 3,
    "StatusDesc": "Sent",
    "Created": "2020-04-24T15:46:43.5109248Z",
    "Updated": null,
    "SubscriptionId": "02071132-1927-4be7-bd24-c5b59749a5b3",
    "SubscriptionAction": 2,
    "SubscriptionActionDesc": "Email",
    "DistributionType": 1,
    "DistributionTypeDesc": "Single",
    "ReadBy": null,
    "PayerName": "Gabbar Singh Pvt Ltd",
    "AccountName": "Samba Roadways"
}

仅当 SubscriptionAction 的值为 2 时,我是否可以使用 Azure Functions 触发 cosmos db 更改源?

【问题讨论】:

    标签: azure azure-functions azure-cosmosdb azure-cosmosdb-sqlapi


    【解决方案1】:

    简短的回答是否定的。确定何时执行某事所需的逻辑和计算必须在 Azure 函数本身内。 Cosmos DB 本身没有确定何时触发更改源的机制。

    【讨论】:

    • 谢谢! @Mark,我们可以仅在插入而不是在更新时触发更改提要 azure 功能吗?
    • 没有。每次更改 Feed 触发。我们正在努力将操作类型包含在更改提要中,以说明操作是什么,但不说明它是否会触发。谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-02-10
    • 1970-01-01
    • 1970-01-01
    • 2023-01-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多