使用PowerShell进行Azure数据工厂管道部署

时间:2019-02-28 14:52:08

标签: azure powershell pipeline azure-data-factory

我创建了一个ADFV2管道,该管道在其进程中使用变量。现在,我想将此管道导出到JSON文件,以便将其用于未来的部署。

不幸的是,当我尝试使用powershell命令“ Set-AzureRmDataFactoryV2Pipeline”在另一个环境中部署管道时,它不起作用。

powershell命令正常运行,但是当我转到ADF接口并选择管道时,出现错误,并且生成的JSON不包含我的变量声明...因此,管道无法运行... < / p>

您知道为什么会出现此问题吗?

以下是我的测试管道的JSON内容(该管道不执行任何操作,仅用于示例):

{
"name": "01_test",
"properties": {
    "activities": [
        {
            "name": "Web1",
            "type": "WebActivity",
            "policy": {
                "timeout": "7.00:00:00",
                "retry": 0,
                "retryIntervalInSeconds": 30,
                "secureOutput": false,
                "secureInput": false
            },
            "typeProperties": {
                "url": {
                    "value": "@variables('test')",
                    "type": "Expression"
                },
                "method": "GET"
            }
        }
    ],
    "variables": {
        "test": {
            "type": "String",
            "defaultValue": "10"
        }
    }
}

}

在那里,使用powershell命令在部署后在新环境中生成了JSON:

{
"name": "01_test",
"properties": {
    "activities": [
        {
            "name": "Web1",
            "type": "WebActivity",
            "policy": {
                "timeout": "7.00:00:00",
                "retry": 0,
                "retryIntervalInSeconds": 30,
                "secureOutput": false,
                "secureInput": false
            },
            "typeProperties": {
                "url": {
                    "value": "@variables('test')",
                    "type": "Expression"
                },
                "method": "GET"
            }
        }
    ]
},
"type": "Microsoft.DataFactory/factories/pipelines"

}

谢谢您的帮助。

1 个答案:

答案 0 :(得分:0)

我已经解决了这个问题。

这是我的AzureRM.DataFactoryV2模块的版本。

更新模块后,一切正常。

相关问题