Azure / Azure/Azure-DataFactory
Trigger payload comparision fails when parameter value is `[]`
- Dominant language
- PowerShell
- Stars
- 529
- Forks
- 623
- PR merge metrics
- No merged PRs in 30d
Description
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:
```json
{
"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:
```powershell
("[]" | ConvertFrom-Json) -eq $null
True
```
Contributor guide
Assessment
This issue has not been assessed yet.