【发布时间】:2020-11-02 20:44:41
【问题描述】:
我害怕把它放在那里,因为它应该很容易,而且我面临与帖子here、here 和here 相同的问题,我尝试了每个答案都无济于事.以下是输入的当前结果输入(已编辑)和相关 CodeView。
结果
{
"method": "post",
"headers": {
"x-ms-documentdb-raw-partitionkey": "\"2020\""
},
"path": "/dbs/xxxx/colls/smtp/docs",
"host": {
"connection": {
"name": "/subscriptions/..."
}
},
"body": {
"category": [
[
"cat facts"
]
],
"email": "example@test.com",
"event": "processed",
"id": "yada",
"partitionKey": "\"2020\"",
"sg_event_id": "yada yada",
"sg_message_id": "yada",
"smtp-id": "yada",
"timestamp": 1604345542
}
}
代码视图
{
"inputs": {
"body": {
"category": [
"@items('For_each')['category']"
],
"email": "@items('For_each')['email']",
"event": "@items('For_each')['event']",
"id": "@items('For_each')['sg_message_id']",
"partitionKey": "\"@{formatDateTime(utcNow(),'yyyy')}\"",
"sg_event_id": "@items('For_each')['sg_event_id']",
"sg_message_id": "@items('For_each')['sg_message_id']",
"smtp-id": "@items('For_each')['smtp-id']",
"timestamp": "@items('For_each')['timestamp']"
},
"headers": {
"x-ms-documentdb-raw-partitionkey": "\"@{formatDateTime(utcNow(),'yyyy')}\""
}
}
我得到的错误是通常的错误 - 从文档中提取的 PartitionKey 与标题中指定的不匹配
我现在看不到我在这里缺少什么。
谢谢大家。
【问题讨论】:
-
您的容器中定义的分区键路径是什么?如果你转到 Azure 门户 > 数据资源管理器,选择容器并转到设置,是否显示
/partitionKey? -
真的很简单——/年
标签: azure-cosmosdb azure-logic-apps