Azure Cosmos DB-使用Azure函数仅针对特定值触发更改提要

Azure Cosmos DB-使用Azure函数仅针对特定值触发更改提要,azure,azure-functions,azure-cosmosdb,azure-cosmosdb-sqlapi,Azure,Azure Functions,Azure Cosmosdb,Azure Cosmosdb Sqlapi,我们想在Cosmos DB change feed上触发Azure函数,但只有在有特定值插入Cosmos DB时才触发 { "EventGuid": "3ecab093-564e-4642-9e5c-097ab89a03c9", "NotificationType": 11, "NotificationTypeDesc": "CardGroupChanged", "UserUUId": "06db4897-e63a-4be7-bd24-c5b59749a5b3",

我们想在Cosmos DB change feed上触发Azure函数,但只有在有特定值插入Cosmos DB时才触发

{
    "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"
}
比如说。下面是我们存储到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函数触发cosmos db change feed吗

简短的回答是否定的。确定何时做某事所需的逻辑和计算必须在Azure函数本身中。在Cosmos DB内部,没有确定何时启动更改提要的机制。

谢谢@马克,我们可以只为插入而不是在更新时触发change feed azure函数吗?不,每次都会触发change feed。我们正在努力将操作类型包括在changefeed中,以说明操作是什么,而不是它是否触发。谢谢