【发布时间】:2020-05-04 08:42:56
【问题描述】:
我有 Azure SQL 数据库,我想使用逻辑应用执行插入、更新、删除操作 是否需要网关同时连接到 Azure SQL DB 到 Logic-app 中的 Sqlserver 连接器我有三个属性 1)Id 2)名称 3)Azure SqlDB 中的部门
**When HTTP Request is Received Code:**
{
"headers": {
"Accept": "application/json",
"Content-Type": "application/json"
},
"properties": {
"Department": {
"type": "string"
},
"Name": {
"type": "string"
},
"id": {
"type": "integer"
}
},
"type": "object"
在 sql 连接器中显示错误请求: Insert -row Connector
属性的Body元素为空
{ "Department": null, "Name": null, "id": null }
插入行连接器的输出 {
"statusCode": 400,
"headers": {
"Pragma": "no-cache",
"x-ms-request-id": "3332d425-3e10-4f04-b618-63f359168acc",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"X-Content-Type-Options": "nosniff",
"X-Frame-Options": "DENY",
"Timing-Allow-Origin": "*",
"x-ms-apihub-cached-response": "false",
"Cache-Control": "no-store, no-cache",
"Date": "Mon, 04 May 2020 08:16:24 GMT",
"Content-Length": "468",
"Content-Type": "application/json",
"Expires": "-1"
},
"body": {
"status": 400,
"message": "Microsoft SQL: Cannot insert the value NULL into column 'id', table '.dbo.Details'; column does not allow nulls. INSERT fails.\r\nclientRequestId: 3332d425-3e10-4f04-b618-63f359168acc",
"error": {
"message": "Microsoft SQL: Cannot insert the value NULL into column 'id', table 'dbo.Details'; column does not allow nulls. INSERT fails."
},
"source": "sql-eus2.azconn-eus2.p.azurewebsites.net"
}
}
注意:我没有使用任何网关,请指导我完成上述任务如果您有任何资源,请让我 知道
逻辑应用定义: Designer
以前的错误历史: error:
我在 Payload 模式中传递的数据: enter image description here
【问题讨论】:
-
你将什么数据传递给 http 触发器??对我来说,错误消息很清楚,您试图在不允许空值的列中插入空值。
-
我在 http 请求中传递有效载荷模式中的数据,但它仍然在正文中显示空值
-
需要连接数据网关?在传递数据时
-
对于azure sql 数据库,不需要网关。请分享以下内容 1)逻辑 APP 定义 2)您发送的示例请求 3)从您的逻辑应用程序运行历史 我问的原因是,您正在做的事情似乎很简单。顺便说一句,您不需要在触发器的主体中传递标题
-
我在代码中添加了三张图片和我已经提交的错误数据
标签: azure azure-sql-database azure-functions azure-web-app-service azure-logic-apps