错误请求 - 空消息 - ADF 中的错误为空 - 复制数据管道

问题描述 投票:0回答:1

延续我之前的一个问题

我创建了 ADF 管道,用于在存储帐户之间复制 Blob 容器及其内部数据,如下所示:

每个活动设置

管道参数为

container_name
它的值为 array 类型:

[
{
    "source_ctr":"app-backup",
    "target_ctr":"app-backup"
},
{
    "source_ctr":"azure-webjobs-hosts",
    "target_ctr":"azure-webjobs-hosts"
},
{
    "source_ctr":"azure-webjobs-secrets",
    "target_ctr":"azure-webjobs-secrets"
},
{
    "source_ctr":"data-app",
    "target_ctr":"data-app"
},
{
    "source_ctr":"data-apptemp",
    "target_ctr":"data-apptemp"
},
{
    "source_ctr":"data-uat",
    "target_ctr":"data-dev"
},
{
    "source_ctr":"db-backup",
    "target_ctr":"db-backup"
}
]

这是第一个复制数据活动 - 用于在存储帐户之间复制容器的源配置:

CopyData1 - 接收器配置:

复制数据2 - 源配置:

接收器配置

为源和目标存储帐户连接创建了两个数据集和链接服务 - 测试连接成功。

当我运行管道时,我收到此错误

{
"code": "BadRequest",
"message": null,
"target": "pipeline//runid/<alpha-numeric-value>",
"details": null,
"error": null
}

Json 中的管道

{
    "name": "AzBlobCtrDataCopyPipeline",
    "properties": {
        "activities": [
            {
                "name": "ForEach",
                "type": "ForEach",
                "dependsOn": [],
                "typeProperties": {
                    "items": {
                        "value": "@pipeline().parameters.container_name",
                        "type": "Expression"
                    },
                    "activities": [
                        {
                            "name": "Copy data1",
                            "type": "Copy",
                            "dependsOn": [],
                            "policy": {
                                "timeout": "0.12:00:00",
                                "retry": 0,
                                "retryIntervalInSeconds": 30,
                                "secureOutput": false,
                                "secureInput": false
                            },
                            "userProperties": [],
                            "typeProperties": {
                                "source": {
                                    "type": "BinarySource",
                                    "storeSettings": {
                                        "type": "AzureBlobStorageReadSettings",
                                        "recursive": true,
                                        "wildcardFolderPath": "*",
                                        "deleteFilesAfterCompletion": false
                                    },
                                    "formatSettings": {
                                        "type": "BinaryReadSettings"
                                    }
                                },
                                "sink": {
                                    "type": "BinarySink",
                                    "storeSettings": {
                                        "type": "AzureBlobStorageWriteSettings",
                                        "copyBehavior": "PreserveHierarchy"
                                    }
                                },
                                "enableStaging": false
                            },
                            "inputs": [
                                {
                                    "referenceName": "SrcSubscnBlobstorageds",
                                    "type": "DatasetReference",
                                    "parameters": {
                                        "container_name": {
                                            "value": "@item().source_ctr",
                                            "type": "Expression"
                                        }
                                    }
                                }
                            ],
                            "outputs": [
                                {
                                    "referenceName": "DestnSubsnBlobstorageds",
                                    "type": "DatasetReference",
                                    "parameters": {
                                        "container_name": {
                                            "value": "@item().target_ctr",
                                            "type": "Expression"
                                        }
                                    }
                                }
                            ]
                        },
                        {
                            "name": "Copy data2",
                            "type": "Copy",
                            "dependsOn": [
                                {
                                    "activity": "Copy data1",
                                    "dependencyConditions": [
                                        "Succeeded"
                                    ]
                                }
                            ],
                            "policy": {
                                "timeout": "0.12:00:00",
                                "retry": 0,
                                "retryIntervalInSeconds": 30,
                                "secureOutput": false,
                                "secureInput": false
                            },
                            "userProperties": [],
                            "typeProperties": {
                                "source": {
                                    "type": "BinarySource",
                                    "storeSettings": {
                                        "type": "AzureBlobStorageReadSettings",
                                        "recursive": false,
                                        "wildcardFileName": "*",
                                        "deleteFilesAfterCompletion": false
                                    },
                                    "formatSettings": {
                                        "type": "BinaryReadSettings"
                                    }
                                },
                                "sink": {
                                    "type": "BinarySink",
                                    "storeSettings": {
                                        "type": "AzureBlobStorageWriteSettings"
                                    }
                                },
                                "enableStaging": false
                            },
                            "inputs": [
                                {
                                    "referenceName": "SrcSubscnBlobstorageds",
                                    "type": "DatasetReference",
                                    "parameters": {
                                        "container_name": {
                                            "value": "@item().source_ctr",
                                            "type": "Expression"
                                        }
                                    }
                                }
                            ],
                            "outputs": [
                                {
                                    "referenceName": "DestnSubsnBlobstorageds",
                                    "type": "DatasetReference",
                                    "parameters": {
                                        "container_name": {
                                            "value": "@item().target_ctr",
                                            "type": "Expression"
                                        }
                                    }
                                }
                            ]
                        }
                    ]
                }
            }
        ],
        "parameters": {
            "sourceSAS": {
                "type": "string",
                "defaultValue": "?hiddenSAStoken"
            },
          "destinationSAS": {
            "type": "string",
            "defaultValue": "?hiddenSAStoken"
          },
            "container_name": {
                "type": "array",
                "defaultValue": [
                    {
                        "source_ctr": "app-backup",
                        "target_ctr": "app-backup"
                    },
                    {
                        "source_ctr": "azure-webjobs-hosts",
                        "target_ctr": "azure-webjobs-hosts"
                    },
                    {
                        "source_ctr": "azure-webjobs-secrets",
                        "target_ctr": "azure-webjobs-secrets"
                    },
                    {
                        "source_ctr": "data-app",
                        "target_ctr": "data-app"
                    },
                    {
                        "source_ctr": "data-apptemp",
                        "target_ctr": "data-apptemp"
                    },
                    {
                        "source_ctr": "data-uat",
                        "target_ctr": "data-dev"
                    },
                    {
                        "source_ctr": "db-backup",
                        "target_ctr": "db-backup"
                    },
                    {
                        "source_ctr": "taskhubdev-applease",
                        "target_ctr": "taskhubdev-applease"
                    },
                    {
                        "source_ctr": "taskhubdev-leases",
                        "target_ctr": "taskhubdev-leases"
                    },
                    {
                        "source_ctr": "taskhubuat-applease",
                        "target_ctr": "taskhubdev-applease"
                    },
                    {
                        "source_ctr": "taskhubuat-largemessages",
                        "target_ctr": "taskhubdev-largemessages"
                    },
                    {
                        "source_ctr": "taskhubuat-leases",
                        "target_ctr": "taskhubdev-leases"
                    },
                    {
                        "source_ctr": "taskhubuatlocal-applease",
                        "target_ctr": "taskhubdevlocal-applease"
                    },
                    {
                        "source_ctr": "taskhubuatlocal-largemessages",
                        "target_ctr": "taskhubdevlocal-largemessages"
                    },
                    {
                        "source_ctr": "taskhubuatlocal-leases",
                        "target_ctr": "taskhubdevlocal-leases"
                    },
                    {
                        "source_ctr": "taskhubuatlocal2-applease",
                        "target_ctr": "taskhubdevlocal2-applease"
                    },
                    {
                        "source_ctr": "taskhubuatlocal2-largemessages",
                        "target_ctr": "taskhubdevlocal2-largemessages"
                    },
                    {
                        "source_ctr": "taskhubuatlocal2-leases",
                        "target_ctr": "taskhubdevlocal2-leases"
                    },
                    {
                        "source_ctr": "taskhubuatlocaln-applease",
                        "target_ctr": "taskhubdevlocaln-applease"
                    },
                    {
                        "source_ctr": "taskhubuatlocaln-leases",
                        "target_ctr": "taskhubdevlocaln-leases"
                    },
                    {
                        "source_ctr": "taskhubuatlocalnn-applease",
                        "target_ctr": "taskhubdevlocalnn-applease"
                    },
                    {
                        "source_ctr": "taskhubuatlocalnn-largemessages",
                        "target_ctr": "taskhubdevlocalnn-largemessages"
                    },
                    {
                        "source_ctr": "taskhubuatlocalnn-leases",
                        "target_ctr": "taskhubdevlocalnn-leases"
                    },
                    {
                        "source_ctr": "taskhubuatnn-applease",
                        "target_ctr": "taskhubdevnn-applease"
                    },
                    {
                        "source_ctr": "taskhubuatnn-largemessages",
                        "target_ctr": "taskhubdevnn-largemessages"
                    },
                    {
                        "source_ctr": "taskhubuatnn-leases",
                        "target_ctr": "taskhubdevnn-leases"
                    },
                    {
                        "source_ctr": "taskhubuatnnlocal-applease",
                        "target_ctr": "taskhubdevnnlocal-applease"
                    },
                    {
                        "source_ctr": "taskhubuatnnlocal-largemessages",
                        "target_ctr": "taskhubdevnnlocal-largemessages"
                    },
                    {
                        "source_ctr": "taskhubuatnnlocal-leases",
                        "target_ctr": "taskhubdevnnlocal-leases"
                    }
                ]
            }
        },
        "annotations": [],
        "lastPublishTime": "2024-04-22T00:25:15Z"
    },
    "type": "Microsoft.DataFactory/factories/pipelines"
}

任何人都可以帮我看看我犯了什么错误以及在哪里犯了错误。

azure azure-data-factory azure-blob-storage azure-storage
1个回答
0
投票

enter image description here

我在定义管道参数时漏掉了‘@’,导致出现了如上所示的错误。将参数定义为

@pipeline().parameters.container_name
后,我的管道成功运行,没有任何错误。

  • 确保您使用正确的语法定义了参数。
  • 检查管道中是否没有语法错误。
  • 正确配置管道。

欲了解更多信息,您可以参考MS Q&A

© www.soinside.com 2019 - 2024. All rights reserved.