逻辑应用程序 - 执行 SQL 服务器存储过程的错误网关 502
Logic Apps - Bad Gateway 502 executing SQL Server stored procedure
我正在尝试执行内部部署的存储过程,它一次从逻辑应用程序插入 1000 条记录。我已经单独测试了存储过程,插入数据只需不到一秒钟的时间,我还使用另一个过程从逻辑应用程序测试了本地网关连接。当我 运行 逻辑应用程序以 JSON 格式从另一个 Web 服务获取数据并传递给本地 SQL 服务器存储过程时,我得到一个错误的网关 (502 ) 错误。
我确实看到 similar question,但 Stack Overflow 上没有回答。由于我没有从错误中看到太多有用的信息,任何人都可以建议如何解决此问题吗?我所看到的只是不支持该命令。感谢您的帮助!
{
"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"
}
}
}
最后,我能够通过对逻辑应用程序和存储过程进行一些调试来解决问题。
修复:问题在于将逻辑应用程序的 'Parse JSON' 输出作为输入传递给存储过程。我使用字符串转换函数来解决这个问题。
我希望 Logic Apps 的未来版本能够提供更具体的异常详细信息,而不是一般的错误网关错误。
我正在尝试执行内部部署的存储过程,它一次从逻辑应用程序插入 1000 条记录。我已经单独测试了存储过程,插入数据只需不到一秒钟的时间,我还使用另一个过程从逻辑应用程序测试了本地网关连接。当我 运行 逻辑应用程序以 JSON 格式从另一个 Web 服务获取数据并传递给本地 SQL 服务器存储过程时,我得到一个错误的网关 (502 ) 错误。
我确实看到 similar question,但 Stack Overflow 上没有回答。由于我没有从错误中看到太多有用的信息,任何人都可以建议如何解决此问题吗?我所看到的只是不支持该命令。感谢您的帮助!
{
"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"
}
}
}
最后,我能够通过对逻辑应用程序和存储过程进行一些调试来解决问题。
修复:问题在于将逻辑应用程序的 'Parse JSON' 输出作为输入传递给存储过程。我使用字符串转换函数来解决这个问题。
我希望 Logic Apps 的未来版本能够提供更具体的异常详细信息,而不是一般的错误网关错误。