[英]Will ADF deployment using azure devops affect existing Pipelines/Jobs in the environment
[英]Automated Deployment of ADF Pipelines using Azure DevOps CI/CD Pipelines
在https://docs.microsoft.com/en-us/azure/data-factory/continuous-integration-deployment (即)部署管道的帮助下,我使用 Azure DevOps CI/CD 管道自动化了 Azure ADF 管道部署过程从 DEV 到 PROD 环境 ADF。 我正在使用 ADF 的 ARM 模板将管道从一个环境部署到另一个环境。 因此,我将有一个单独的 ARM_Parameter.json 对应于每个环境(开发/生产)。 问题是每个 ADF 管道可能有很少的基本参数,这些基本参数没有被参数化,因此它在 parameter.json 中不可用。 在这个使用 CI/CD 管道的自动化 ADF 管道部署过程中,你们能帮我以自动化的方式在每个 ADF 管道下的基本参数部分用 PROD 值替换开发值吗?
我看到两个选项:
您可以将自定义参数与 ARM 模板一起使用。 Pipeline 的自定义参数可能如下所示:
"Microsoft.DataFactory/factories/pipelines": {
"properties": {
"parameters": {
"RUN_ENVIRONMENT": "=:-:string"
}
}
},
将开发值替换为基本参数部分中的 PROD 值
根据您的截图, RUN_ENVIRONMENT
是管道的参数,这意味着在转换为 ARM 模板时,其格式如下:
"resources": [
{
....
....
"properties": {
"parameters": {
"RUN_ENVIRONMENT": {
"type": "string",
"defaultValue": "pro"
}
},...
},...
}
]
它不能被 ARM 部署任务中使用Override template parameters
替换。 因为会提示The template parameters 'environment' in the parameters file are not valid; they are not present in the original template and can therefore not be provided at deployment time.
The template parameters 'environment' in the parameters file are not valid; they are not present in the original template and can therefore not be provided at deployment time.
要解决此错误,只需安装一个扩展并将Replace token
任务添加到 ARM 部署任务之前的管道中。 此任务将在构建运行时替换 content 的值:
还有另一种从 master(协作)分支发布 ADF 的方法。 您可以为 JSON 文件(ADF 对象)中的每个节点(属性)定义(替换)值。 它将解决您的问题,因为您可以为每个环境(阶段)提供一个单独的 CSV 配置文件。
CSV 配置文件示例 ( config-stage-UAT.csv
):
type,name,path,value
pipeline,PL_CopyMovies,activities[0].outputs[0].parameters.BlobContainer,UAT
然后只需在 PowerShell 中运行这样的 cmdlet:
Publish-AdfV2FromJson -RootFolder "$RootFolder" -ResourceGroupName "$ResourceGroupName" -DataFactoryName "$DataFactoryName" -Location "$Location" -Stage "stage-UAT"
看看这个: azure.datafactory.tools (PowerShell 模块)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.