Skip to content

Trigger payload comparision fails when parameter value is [] #540

Open

Description

@aurelschwitter

When comparing triggers with the PrePostDeploymentScript.Ver2.ps1, the script fails to compare triggers where there are payload parameters with an empty array as value.

Sample trigger configuration:

{
    "name": "schedule_daily_datasource",
    "properties": {
        "annotations": [],
        "runtimeState": "Started",
        "pipelines": [
            {
                "pipelineReference": {
                    "referenceName": "0_orchestrate_dataSource_full",
                    "type": "PipelineReference"
                },
                "parameters": {
                    "thresholdNumberOfRows": 100000,
                    "fullDataTablesConfig": []
                }
            }
        ],
        "type": "ScheduleTrigger",
        "typeProperties": {
            "recurrence": {
                "frequency": "Day",
                "interval": 1,
                "startTime": "2022-09-21T09:32:00Z",
                "timeZone": "UTC",
                "schedule": {
                    "minutes": [
                        30
                    ],
                    "hours": [
                        4
                    ]
                }
            }
        }
    }
}

The script then fails with the following error:

Comparing 'schedule_daily_datasource' trigger payload
##[warning] Unable to compare 'schedule_daily_datasource' trigger payload, this is not a failure. You can post the issue to https://github.com/Azure/Azure-DataFactory/issues to check if this is user error or limitation.
##[warning] Cannot bind argument to parameter 'ReferenceObject' because it is null. from Line: 428

The issue is that the empty array evaluates to $null in Line 428 and Compare-Object does not accept null values.

See example:

("[]" | ConvertFrom-Json) -eq $null
True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions