gpt4 book ai didi

Azure ARM DataFactory InvalidTemplate runAfter 属性无效;范围必须属于同一级别

转载 作者:行者123 更新时间:2023-12-02 23:53:18 25 4
gpt4 key购买 nike

在这里记录我学到的东西,以防对其他人有帮助。我有一个实现 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com