最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

azure - Preventing Trigger Overwrites in ADF ARM Deployments - Stack Overflow

programmeradmin2浏览0评论

I'm new to Azure, and I am deploying an Azure Data Factory (ADF) using an ARM template in Azure DevOps via a YAML file from DEV environment to QA environment. The problem is the triggers in DEV are overwriting the triggers in QA, which leads re-configuring the triggers in QA again.

My goal is to update pipelines, datasets, and other resources without modifying or overwriting existing triggers in the target environment.

This is the trigger in the ARMTemplateForFactory.json:

{
        "name": "[concat(parameters('factoryName'), '/MorningSchedule')]",
        "type": "Microsoft.DataFactory/factories/triggers",
        "apiVersion": "2018-06-01",
        "properties": {
            "annotations": [],
            "runtimeState": "Stopped",
            "pipelines": [
                {
                    "pipelineReference": {
                        "referenceName": "name_of_pipeline",
                        "type": "PipelineReference"
                    },
                    "parameters": {
                        "_parameter": "[parameters('name_of_parameter')]"
                    }
                }
            ],
            "type": "ScheduleTrigger",
            "typeProperties": {
                "recurrence": {
                    "frequency": "Day",
                    "interval": 1,
                    "startTime": "2023-11-30T11:30:00",
                    "endTime": "2026-12-01T09:30:00",
                    "timeZone": "Middle East Standard Time",
                    "schedule": {
                        "minutes": [
                            55
                        ],
                        "hours": [
                            9
                        ]
                    }
                }
            }
        },
        "dependsOn": [
            "[concat(variables('factoryId'), '_pipeline')]"
        ]
    }

And i was trying to play with the parametrization via the arm-template-parameters-definition.json but idk if that's will help. this is the code for triggers inside the arm-template-parameters-definition.json:

"Microsoft.DataFactory/factories/triggers": {
    "properties": {
        "pipelines": [
            {
                "parameters": {
                    "*": "="
                }
            },
            "pipelineReference.referenceName"
        ],
        "pipeline": {
            "parameters": {
                "*": "="
            }
        },
        "typeProperties": {
            "scope": "="
        }
    }
}

I've deleted the triggers manually from ARMTemplateForFactory.json but that deleted them from QA. It's deleting the triggers that is in QA env and replacing them with the triggers from the DEV env.

The YAML file is quite big, but i think this is the important part:

- task: AzureResourceManagerTemplateDeployment@3
  displayName: '...'
  inputs:
    deploymentScope: 'Resource Group'
    azureResourceManagerConnection: ...       
    subscriptionId: ...
    action: 'Create Or Update Resource Group'
    resourceGroupName: ...
    location: target_env_location
    templateLocation: 'Linked artifact'
    csmFile: Path to ARMTemplateForFactory.json
    csmParametersFile: Path to ARMTemplateParametersForFactory.json
    deploymentMode: 'Incremental'
    deploymentName: 'Name of Deployment'
    overrideParameters: 'Some Parameters'

I'm looking to see if there's a solution that will allow me to exclude triggers from the deployment process.

发布评论

评论列表(0)

  1. 暂无评论