使用 PowerShell 部署 Azure 数据工厂管道
Azure Data Factory Pipeline deployment with PowerShell
我创建了一个在其进程中使用变量的 ADFV2 管道。现在我想将此管道导出到 JSON 文件,以便将其用于未来的部署。
不幸的是,当我尝试使用 powershell 命令在另一个环境中部署管道时 "Set-AzureRmDataFactoryV2Pipeline",它不起作用。
powershell命令运行正常,但是当我去ADF接口和select我的管道时,出现错误,生成的JSON不包含我的变量声明...所以管道不能运行...
你知道为什么会出现这个问题吗?
这是我的测试管道的 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"
}
感谢您的帮助。
我今天解决了这个问题。
这是我的 AzureRM.DataFactoryV2 模块版本。
更新模块后,一切正常。
我创建了一个在其进程中使用变量的 ADFV2 管道。现在我想将此管道导出到 JSON 文件,以便将其用于未来的部署。
不幸的是,当我尝试使用 powershell 命令在另一个环境中部署管道时 "Set-AzureRmDataFactoryV2Pipeline",它不起作用。
powershell命令运行正常,但是当我去ADF接口和select我的管道时,出现错误,生成的JSON不包含我的变量声明...所以管道不能运行...
你知道为什么会出现这个问题吗?
这是我的测试管道的 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"
}
感谢您的帮助。
我今天解决了这个问题。
这是我的 AzureRM.DataFactoryV2 模块版本。
更新模块后,一切正常。