Azure 数据工厂部署中的 CICD 发布管道问题

时间:2021-02-10 04:53:16

标签: json git azure azure-devops azure-data-factory-2

我在 Azure DevOps 中创建了一个发布管道,我将在其中将开发资源(管道、数据集、触发器、集成运行时)移动到 Prod 数据工厂。

挑战是,在我的开发 ADF 中,我使用了一个集成运行时,比如自托管和共享的 ir-myonpremdata,并且相同的 ir 也作为自托管链接出现在 prod 数据工厂中。 每当我部署管道时,我都会使用以下内容更新工厂和 JSON 的 arm_templates

1.  ARMTemplateForFactory.JSON-code-

    {
        "name": "[concat(parameters('factoryName'), '/ir-myonpremdata')]",
        "type": "Microsoft.DataFactory/factories/integrationRuntimes",
        "apiVersion": "2018-06-01",
        "properties": {
            "type": "SelfHosted",
            "typeProperties": {
                "linkedInfo": {
                    "resourceId": "[parameters(**'ir-myonpremdata_properties_typeProperties_linkedInfo_resourceId'**)]",
                    "authorizationType": "Rbac"
                }
            }
        },
        "dependsOn": []
    }

2.  ARMTemplateParametersForFactory.json-

       
     "**ir-myonpremdata_properties_typeProperties_linkedInfo_resourceId**": {
            "type": "string",
            "defaultValue": "/subscriptions/d9368466-XXXX-4d83-XXXX-bb9f336fb6a7/resourcegroups/ModernDataPlatform/providers/Microsoft.DataFactory/factories/cpo-adf-dev/integrationruntimes/ir-myonpremdata"
        }

然后我就可以部署 ADF,否则它会不断抛出错误消息。但这是非常痛苦的,如果再次有人将发布主分支,然后在 adf_publish 分支中,额外的代码段将从 ARMTemplateForFactory.JSON 和 ARMTemplateParametersForFactory.json 中自动删除(正如我们手动添加的那样),并且发布管道将继续失败.

我不想在有人从 adf 分支发布时不断更新我的 JSON 文件。

1 个答案:

答案 0 :(得分:0)

我有一个类似的问题...在这种情况下,最佳实践建议是在单独的 ADF 上有一个共享 IR,只是为了托管 IR,然后在所有开发/测试/生产 ADF 中使用链接的 IR。

https://docs.microsoft.com/en-us/azure/data-factory/continuous-integration-deployment#best-practices-for-cicd

我正在尝试这样做......无论是否有效,都会更新。