Azure-Player / azure.datafactory.tools

Tools for deploying Data Factory (v2) in Microsoft Azure
https://azureplayer.net/adftools
MIT License
219 stars 70 forks source link

Allow config entries to index into arrays using names or index id's #98

Closed NJLangley closed 3 years ago

NJLangley commented 3 years ago

We have been using the deployment config JSON file to override a timeout setting on the ADF.ProcFwk project using code like this:

"04-Infant": [
    {
      "name": "$.properties.activities[7].typeProperties.timeout",
      "value": "0.06:00:00",
      "action": "update"
    }
  ]

It would be nicer to be able to write target property using a syntax like:

"04-Infant": [
    {
      "name": "$.properties.activities['Wait Until Pipeline Completes'].typeProperties.timeout",
      "value": "0.06:00:00",
      "action": "update"
    }
  ]

This would mean the target is correct even if the pipeline JSON is modified such that the order of activities changes. It also makes the config more readable.

I have some code that solves this by converting the arrays returned by ConvertFrom-Json into ordered hash tables, which allow indexing via key or indexer (so existing functionality is unchanged). I'll submit a PR with the change for consideration.

NowinskiK commented 3 years ago

Great, go for it, Niall. This is one of the things I was aware of but did not know how to manage.

NowinskiK commented 3 years ago

Will be rolled out in the nearest release.