Azure / Azure/Azure-DataFactory

CI/CD Script does not detect changes in parameter values in object arrays

Open
#542 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
PowerShell
Stars
529
Forks
623
PR merge metrics
No merged PRs in 30d

Description

Example trigger config:

```json
{
"name": "schedule_daily_execution",
"properties": {
"annotations": [],
"runtimeState": "Started",
"pipelines": [
{
"pipelineReference": {
"referenceName": "my_pipeline",
"type": "PipelineReference"
},
"parameters": {
"tableConfig": [
{
"tableName": "table1"
},
{
"tableName": "table2"
}
]
}
}
],
"type": "ScheduleTrigger",
"typeProperties": {
"recurrence": {
"frequency": "Day",
"interval": 1,
"startTime": "2022-09-21T09:32:00Z",
"timeZone": "UTC",
"schedule": {
"minutes": [
30
],
"hours": [
4
]
}
}
}
}
}
```

When changing the table names to "table3" and "table4", the script does not detect a change because compare-object does not compare array contents:
```powershell
pwsh > $oldConfig = '[{"tableName":"table1"},{"tableName":"table2"}]'
pwsh > $newConfig = '[{"tableName":"table3"},{"tableName":"table4"}]'
pwsh > Compare-Object (ConvertFrom-Json $oldConfig) (ConvertFrom-Json $newConfig)
# no output --> no change
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.