作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在这里记录我学到的东西,以防对其他人有帮助。我有一个实现 DataFactory 管道的 ARM 模板,它有一个奇怪的 InvalidTemplate 错误。我正在将我的模板简化为一个人为的简单模板,
resources: [
{
"name": "blah",
"type": "Microsoft.DataFactory/factories/pipelines",
"apiVersion": "2018-06-01",
"properties": {
"activities": [
{
"name": "Foo",
"type": "SetVariable",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"variableName": "hi",
"value": {
"value": "int(1)",
"type": "Expression"
}
}
},
{
"name": "CoolIf",
"type": "IfCondition",
"typeProperties": {
"expression": {
"value": "@bool(equals(variables('hi'), 1))",
"type": "Expression"
},
"ifTrueActivities": [
{
"name": "Blarg",
"type": "SetVariable",
"dependsOn": [{"activity": "Foo"}],
"userProperties": [],
"typeProperties": {
"variableName": "okay",
"value": {
"value": "@string(1 + int(variables('hi')))",
"type": "Expression"
}
}
},
],
"ifFalseActivities": []
}
}
]
}
}
]
产生错误消息
ErrorCode=InvalidTemplate, ErrorMessage=The template validation
failed: 'The 'runAfter' property of template action 'BlargScope'
is not valid: the action 'FooScope' must belong to same level as
action 'BlargScope'. Available actions on same level: ''
我在网上找不到好的答案。
最佳答案
经过一天的尝试和错误,我意识到您可以在 IfCondition
父级中放置 dependsOn
,因此下面,只需移动 dependsOn
从子级 Blarg
到父级 CoolIf
。然后它开始工作=)。
resources: [
{
"name": "blah",
"type": "Microsoft.DataFactory/factories/pipelines",
"apiVersion": "2018-06-01",
"properties": {
"activities": [
{
"name": "Foo",
"type": "SetVariable",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"variableName": "hi",
"value": {
"value": "int(1)",
"type": "Expression"
}
}
},
{
"name": "CoolIf",
"type": "IfCondition",
"dependsOn": [{"activity": "Foo"}],
"typeProperties": {
"expression": {
"value": "@bool(equals(variables('hi'), 1))",
"type": "Expression"
},
"ifTrueActivities": [
{
"name": "Blarg",
"type": "SetVariable",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"variableName": "okay",
"value": {
"value": "@string(1 + int(variables('hi')))",
"type": "Expression"
}
}
},
],
"ifFalseActivities": []
}
}
]
}
}
]
现在回想起来,我觉得这很愚蠢,哈哈。
关于Azure ARM DataFactory InvalidTemplate runAfter 属性无效;范围必须属于同一级别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/75476011/
在这里记录我学到的东西,以防对其他人有帮助。我有一个实现 DataFactory 管道的 ARM 模板,它有一个奇怪的 InvalidTemplate 错误。我正在将我的模板简化为一个人为的简单模板,
在这里记录我学到的东西,以防对其他人有帮助。我有一个实现 DataFactory 管道的 ARM 模板,它有一个奇怪的 InvalidTemplate 错误。我正在将我的模板简化为一个人为的简单模板,
我是一名优秀的程序员,十分优秀!