我试图在内部执行存储过程,该存储过程一次从Logic App插入1000条记录。我已经分别测试了存储过程,并且花费了不到一秒钟的时间插入了数据,并且我还通过了Logic Apps中的另一个过程对本地网关连接进行了测试。当我运行以JSON格式从另一个Web服务获取数据并传递到内部SQL Server存储过程的Logic Apps时,我遇到了错误的网关(502)错误。
我确实看到了similar question,但是在堆栈溢出中却没有得到回答。由于我没有从该错误中看到太多有用的信息,因此谁能建议如何解决此问题?我所看到的就是不支持该命令。感谢您的帮助!
{
"error": {
"code": 502,
"source": "logic-apis-centralus.azure-apim.net",
"clientRequestId": "xxxxxxx",
"message": "BadGateway",
"innerError": {
"status": 502,
"message": **"The command '**[ AzureConnection = [gateway=\"true\",server=\"xxx.com\",database=\"xxx\"],\r\n request = [Connection = AzureConnection],\r\n dataSet = \"default\",\r\n procedure = \"[dbo].[UpsertEventData]\",\r\n parameters = [jsonObject=[\r\n {\r\n \"eventId\": \"a835795db0f7a13ab03be8e41bde7f56bc9b772905d82e7c111252d998a002be\",\r\n \"startTime\": \"2018-09-26T00:23:06+00:00\",\r\n \"endTime\": \"2018-09-26T00:24:50+00:00\",\r\n \"userId\": \"6aa080743b27d1a9a67afd2683ede38a\",\r\n \"channelId\": \"987fb87a4f7b4d867c1f391d38ec98b2\",\r\n \"shareId\": null,\r\n \"deviceId\": \"bdf8ada28095551a705737900d7c5bf3\",\r\n \"divisionId\": null,\r\n,\r\n \"contactId\": null,\r\n \"type\": \"asset-in-app-viewed\",\r\n \"page\": 1\r\n }, **isn't supported.**\r\n **inner exception:** The command '[ AzureConnection = [gateway=\"true\",server=\"xxx.com\",database=\"xxx\"],\r\n request = [Connection = AzureConnection],\r\n dataSet = \"default\",\r\n procedure = \"[dbo].[UpsertEventData]\",\r\n parameters = [jsonObject=[\r\n {\r\n \"eventId\": \"a835795db0f7a13ab03be8e41bde7f56bc9b772905d82e7c111252d998a002be\",\r\n \"startTime\": \"2018-09-26T00:23:06+00:00\",\r\n \"endTime\": \"2018-09-26T00:24:50+00:00\",\r\n \"userId\": \"6aa080743b27d1a9a67afd2683ede38a\",\r\n \"channelId\": \"987fb87a4f7b4d867c1f391d38ec98b2\",\r\n \"shareId\": null,\r\n \"deviceId\": \"bdf8ada28095551a705737900d7c5bf3\",\r\n \"divisionId\": null,\r\n \"assetId\": \"44ecbff1f7427e1fdc2bc3e1ad47f827\",\r\n \"contactId\": null,\r\n \"type\": \"asset-in-app-viewed\",\r\n \"page\": 1\r\n },\r\n {\r\n \"eventId\": \"a835795db0f7a13ab03be8e41bde7f5666f3195ab9eaf651a159d6ce22b04cc7\",\r\n \"startTime\": \"2018-09-26T00:25:45+00:00\",\r\n \"endTime\": \"2018-09-26T00:25:49+00:00\",\r\n \"userId\": \"6aa080743b27d1a9a67afd2683ede38a\",\r\n \"channelId\": \"7ae82...**' isn't supported.**\r\nclientRequestId: 7d9cbf4d-b50f-4905-8825-554f7e48d54c",
"source": "sql-logic-cp-centralus.logic-ase-centralus.p.azurewebsites.net"
}
}
}
答案 0 :(得分:0)
最后,我可以通过对Logic Apps和Stored Proc进行一些调试来解决此问题。
修复:问题是将Logic Apps的“解析JSON”输出作为输入传递给存储过程。我使用了字符串转换功能来解决此问题。
我希望Logic Apps的将来版本会提供更具体的异常详细信息,而不是一般的网关错误。