database - Azure 数据工厂管道复制多个表失败
问题描述
我的第一篇文章,如果我做错了什么,请提前道歉
我已按照以下 Microsoft 文档的说明进行操作,并创建了一个数据工厂以将多个表的数据从本地数据库复制到 Azure 数据库。
管道失败并出现以下错误:
PipelineName : GetTableListAndTriggerCopyData
LastUpdated : 3/20/2020 10:16:42 AM
Parameters : {}
RunStart : 3/20/2020 10:16:10 AM
RunEnd : 3/20/2020 10:16:42 AM
DurationInMs : 32430
Status : Failed
Message : Operation on target TriggerCopy failed:Operation on target IterateSQLTables failed: Activity failed because an inner activity failed
两个管道的 Json 数据如下:
第一个管道 IterateAndCopySQLTables
{
"name": "IterateAndCopySQLTables",
"properties": {
"activities": [
{
"name": "IterateSQLTables",
"type": "ForEach",
"typeProperties": {
"isSequential": "false",
"items": {
"value": "@pipeline().parameters.tableList",
"type": "Expression"
},
"activities": [
{
"name": "CopyData",
"description": "Copy data from On Prem SQL database to Azure SQL database",
"type": "Copy",
"inputs": [
{
"referenceName": "OnPremSourceDataset",
"type": "DatasetReference"
}
],
"outputs": [
{
"referenceName": "AzureSinkDataset",
"type": "DatasetReference",
"parameters": {
"SinkTableName": "[@{item().TABLE_NAME}]"
}
}
],
"typeProperties": {
"source": {
"type": "SqlSource",
"sqlReaderQuery": "SELECT * FROM dbo.[@{item().TABLE_NAME}]"
},
"sink": {
"type": "AzureSqlSink",
"preCopyScript": "TRUNCATE TABLE dbo.[@{item().TABLE_NAME}]"
}
}
}
]
}
}
],
"parameters": {
"tableList": {
"type": "Array"
}
}
}
}
第二个管道:GetTableListAndTriggerCopyData
{
"name":"GetTableListAndTriggerCopyData",
"properties":{
"activities":[
{
"name": "LookupTableList",
"description": "Retrieve the table list from On Prem SQL database",
"type": "Lookup",
"typeProperties": {
"source": {
"type": "SqlSource",
"sqlReaderQuery": "SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = 'dbo' and TABLE_NAME in ('Brd','Loc')"
},
"dataset": {
"referenceName": "OnPremSourceDataset",
"type": "DatasetReference"
},
"firstRowOnly": false
}
},
{
"name": "TriggerCopy",
"type": "ExecutePipeline",
"typeProperties": {
"parameters": {
"tableList": {
"value": "@array(activity('LookupTableList').output.value)",
"type": "Expression"
}
},
"pipeline": {
"referenceName": "IterateAndCopySQLTables",
"type": "PipelineReference"
},
"waitOnCompletion": true
},
"dependsOn": [
{
"activity": "LookupTableList",
"dependencyConditions": [
"Succeeded"
]
}
]
}
]
}
}
解决方案
感谢大家的评论。
问题出在(GetTableListAndTriggerCopyData)
"value": "@array(activity('LookupTableList').output.value)", 错了,正确的语法是: "value": "@activity('LookupTableList').output.value)",
推荐阅读
- amazon-web-services - 在另一个账户中使用 lambda 订阅 AWS RDS 事件
- python - 为什么我的乌龟和另一个物体的坐标不一样,即使它们在同一个地方?
- jquery - 清除 Select2 选择 onclick
- r - 将逗号分隔的列转换为多列
- android - MediaPlayer 损坏的 url 问题
- python - 为什么我的while循环中的函数不使用更新的变量值
- python - AttributeError:“元组”对象没有属性“_committed”
- java - 如何制作一个接受两种类型参数的 Java 程序?
- blockchain - 以太坊,使用哪种同步模式,快速还是完整?
- mysql - 减少微实例的 mariadb 15.1.41 的内存消耗