发布后如何在Azure模板参数文件(ARMTemplateParametersForFactory.json)中获取Azure数据工厂参数 [英] How to get the Azure Data Factory parameters into the ARM template parameters file (ARMTemplateParametersForFactory.json) after publishing
问题描述
我正在尝试为Azure数据工厂创建Azure DevOps发布管道.
I am trying to create my Azure DevOps release pipeline for Azure Data Factory.
我遵循了Microsoft颇为神秘的指南( https://docs.microsoft.com/zh-cn/azure/data-factory/continuous-integration-deployment ),有关向发布时生成的ARM模板添加其他参数( https://docs.microsoft.com/zh-CN/azure/data-factory/continuous-integration-deployment#use-custom-parameters-with-the-resource-manager-template )
I have followed the rather cryptic guide from Microsoft (https://docs.microsoft.com/en-us/azure/data-factory/continuous-integration-deployment ) regarding adding additional parameters to the ARM template that gets generated when you do a publish (https://docs.microsoft.com/en-us/azure/data-factory/continuous-integration-deployment#use-custom-parameters-with-the-resource-manager-template )
在master分支的路由中创建了arm-template-parameters-definition.json
文件.当我进行发布时,adf_publish
分支中的ARMTemplateParametersForFactory.json
保持完全不变.我尝试了许多配置.
Created a arm-template-parameters-definition.json
file in the route of the master branch. When I do a publish, the ARMTemplateParametersForFactory.json
in the adf_publish
branch remains completely unchanged. I have tried many configurations.
我已经在Data Factory中定义了一些管道参数,并希望它们可以在我的部署管道中进行配置.对我来说似乎是一个明显的要求.
I have defined some Pipeline Parameters in Data Factory and want them to be configurable in my deployment pipeline. Seems like an obvious requirement to me.
我错过了一些基本的东西吗?请帮忙!
Have I missed something fundamental? Help please!
JSON如下:
{
"Microsoft.DataFactory/factories/pipelines": {
"*": {
"properties": {
"parameters": {
"*": "="
}
}
}
},
"Microsoft.DataFactory/factories/integrationRuntimes": {
"*": "="
},
"Microsoft.DataFactory/factories/triggers": {},
"Microsoft.DataFactory/factories/linkedServices": {},
"Microsoft.DataFactory/factories/datasets": {}
}
推荐答案
我已经为此苦苦挣扎了几天,却没有找到很多信息,所以在这里我找到了.您必须将arm-template-parameters-definition.json
放在协作分支的已配置根文件夹中:
I've been struggling with this for a few days and did not found a lot of info, so here what I've found out. You have to put the arm-template-parameters-definition.json
in the configured root folder of your collaboration branch:
所以在我的示例中,它必须看起来像这样:
So in my example, it has to look like this:
如果在单独的分支中工作,则可以通过从数据工厂下载手臂模板来测试配置.在参数定义中进行更改时,必须重新加载浏览器屏幕(f5)以刷新配置.
If you work in a separate branch, you can test your configuration by downloading the arm templates from the data factory. When you make a change in the parameters-definition you have to reload your browser screen (f5) to refresh the configuration.
如果您真的想对所有管道中的所有参数进行参数化,则应执行以下操作:
If you really want to parameterize all of the parameters in all of the pipelines, the following should work:
"Microsoft.DataFactory/factories/pipelines": {
"properties": {
"parameters":{
"*":{
"defaultValue":"="
}
}
}
}
我更喜欢指定要参数化的参数:
I prefer specifying the parameters that I want to parameterize:
"Microsoft.DataFactory/factories/pipelines": {
"properties": {
"parameters":{
"LogicApp_RemoveFileFromADLSURL":{
"defaultValue":"=:-LogicApp_RemoveFileFromADLSURL:"
},
"LogicApp_RemoveBlob":{
"defaultValue":"=:-LogicApp_RemoveBlob:"
}
}
}
}
这篇关于发布后如何在Azure模板参数文件(ARMTemplateParametersForFactory.json)中获取Azure数据工厂参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!