You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

调用Azure Synapse Pipeline创建API加载PLDB2资源报错求助

Azure Synapse Pipeline REST API 创建含Databricks Notebook活动管道报错排查

调用Azure Synapse Pipeline Create Pipeline REST API创建包含Databricks Notebook活动的管道后,Synapse界面报错:

无法加载资源'PLDB2'。请确保JSON无错误且引用资源存在。状态:Cannot read properties of undefined (reading 'toLowerCase'),可能原因:Cannot read properties of undefined (reading 'toLowerCase')

手动创建同配置的管道可正常运行,相关请求及管道信息如下:

请求地址:https://mysynapseworkspace.dev.azuresynapse.net/pipelines/PLDB2?api-version=2020-12-01

原请求体JSON:

{"name": "PLDB2","properties": {"description": "Databricks Notebook","activities": [{"activity": {"name": "MyActivity","description": "MyActivity description","type": "DatabricksNotebook","linkedServiceName": {"referenceName": "LS_Databricks",  "type": "LinkedServiceReference"},"typeProperties": {            "notebookPath": "/Users/abc@myemail.com/Test_Job_1"}}}]}}

创建后的管道信息:

{"id": "/subscriptions/mysubscription/resourceGroups/myresourcegroup/providers/Microsoft.Synapse/workspaces/mysynapseworkspace/pipelines/PLDB2","name": "PLDB2","type": "Microsoft.Synapse/workspaces/pipelines","etag": "9400d55f-0000-0100-0000-63b180e40000","properties": {"description": "Databricks Notebook","activities": [{"activity": {"name": "MyActivity","description": "MyActivity description","type": "DatabricksNotebook","linkedServiceName": {"referenceName": "LS_Databricks_Personify","type": "LinkedServiceReference"},"typeProperties": {"notebookPath": "/Users/nlaw@quaerainsights.com/Test_Job_1"}}}],"lastPublishTime": "2023-01-01T12:47:32Z"}}

问题根源

请求体中activities数组的结构不符合Synapse API规范:每个活动对象被错误嵌套在activity字段下,而正确格式应直接将活动对象放入activities数组,无需外层activity键。这种结构错误会导致Synapse解析管道定义时触发未定义属性读取异常,即报错中的Cannot read properties of undefined (reading 'toLowerCase')。

修正后的请求体JSON

{
  "name": "PLDB2",
  "properties": {
    "description": "Databricks Notebook",
    "activities": [
      {
        "name": "MyActivity",
        "description": "MyActivity description",
        "type": "DatabricksNotebook",
        "linkedServiceName": {
          "referenceName": "LS_Databricks",
          "type": "LinkedServiceReference"
        },
        "typeProperties": {
          "notebookPath": "/Users/abc@myemail.com/Test_Job_1"
        }
      }
    ]
  }
}

验证说明

手动创建管道时,Synapse会自动生成正确的JSON结构,不会包含多余的activity嵌套字段。使用修正后的请求体调用REST API,创建的管道可被正常加载,且能正常运行Databricks Notebook活动。

内容的提问来源于stack exchange,提问作者G. Young

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.06 07:25:14