Azure Logic应用:GROUP BY查询不支持Continuation令牌

问题描述

我正在尝试使用Azure Logic Apps中的Group By子句查询具有1.5m文档的单个分区。

我可以在Cosmos Data Explorer中运行逻辑应用程序中编码的查询,而不会出现问题:

[{
    "AreasProcessed": 1,"TotalProperties": 1286,"status": 500
},{
    "AreasProcessed": 45,"TotalProperties": 0,"status": 400
},{
    "AreasProcessed": 2275,"TotalProperties": 2399469,"status": 200
}]

但是,当我在Logic App中运行查询时,出现以下错误

Continuation token is not supported for queries with GROUP BY. Do not use FeedResponse.ResponseContinuation or remove the GROUP BY from the query.

我已在Logic App上启用了分页和异步模式。

以下是逻辑应用程序的全部错误,有人可以帮我吗?

{"error": {
    "code": 500,"source": "logic-apis-westeurope.azure-apim.net","clientRequestId": "4d6a4cdb-8969-4dd7-b382-90929c7ec829","message": "BadGateway","innerError": {
        "status": 500,"message": "Continuation token is not supported for queries with GROUP BY. Do not use FeedResponse.ResponseContinuation or remove the GROUP BY from the query.\r\nclientRequestId: 4d6a4cdb-8969-4dd7-b382-90929c7ec829","error": {
            "message": "Continuation token is not supported for queries with GROUP BY. Do not use FeedResponse.ResponseContinuation or remove the GROUP BY from the query."
        },"source": "documentdb-we.azconn-we.p.azurewebsites.net"
    }
}}

解决方法

据我所知,azure团队已集成了“ 文档资源管理器”,“ 查询资源管理器”,“ 脚本资源管理器”功能, “数据资源管理器”的一部分。因此,“ 数据资源管理器”是执行查询的最佳方法。我不确定azure逻辑应用程序是否使用与“ 查询资源管理器”或“ 文档资源管理器”相同的后端,但似乎该逻辑应用程序没有使用相同的后端和“ 数据浏览器”。我认为这是为什么您可以在门户网站上的“数据资源管理器”中运行查询但不能在逻辑应用程序中运行查询的原因。

对于此问题,您可以create使用azure函数并使用该函数中的代码进行查询。然后call在您的逻辑应用程序中使用该功能。这是另一个post,与您的问题类似(但不相同),供您参考。