Azure Cosmos DB - 使用 Azure Functions 仅针对特定值触发更改源
Azure Cosmos DB- Trigger Change Feed only for specific values using Azure Functions
我们想要触发 Cosmos DB 上的 Azure Function 更改源,但仅当有特定值插入到 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 函数本身内。 Cosmos DB 本身没有确定何时触发 Change Feed 的机制。
我们想要触发 Cosmos DB 上的 Azure Function 更改源,但仅当有特定值插入到 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 函数本身内。 Cosmos DB 本身没有确定何时触发 Change Feed 的机制。