Azure-Player / azure.datafactory.tools

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

Using tokens as dynamic values creates empty string error during validation #353

Open mrWiecek opened 1 year ago

mrWiecek commented 1 year ago

Current Behavior:

Using Azure DevOps build task During validation in Azure Devops Build pipelines following error occurs:

=== Validating other rules ...
Checking duplicated names...
Checking names of datasets, pipelines, dataflows...
Checking: Global parameter names...
=== Validating config files ...
Checking config file: C:\agents\vsts-agent-win-x64-2.194.0\_work\13\s\ADF\deployment\config.json...
Config file:   C:\agents\vsts-agent-win-x64-2.194.0\_work\13\s\ADF\deployment\config.json
ERROR: Cannot bind argument to parameter 'value' because it is an empty string.
=============================================================================================
 ADF                                                                          # of Errors: 1
 Test code failed.                                                          # of Warnings: 0
=============================================================================================

Expected Behavior:

=== Validating config files ...
Checking config file: C:\agents\vsts-agent-win-x64-2.194.0\_work\13\s\ADF\deployment\config.json...
Config file:   C:\agents\vsts-agent-win-x64-2.194.0\_work\13\s\ADF\deployment\config.json
*** Properties modification report ***

Added Removed Updated
----- ------- -------
    0       0      32

=============================================================================================
 ADF                                                                          # of Errors: 0
 Test code completed (126 objects).                                         # of Warnings: 0
=============================================================================================

Steps To Reproduce:

  1. Create a config file in json config.json
  2. Update arbitrary object ex. global parameter value environment using dynamic values as the only thing as value in parameter value :).
    "adf-dev": [
        {
            "name": "$.properties.globalParameters.environment.value",
            "value": "$Env:env",
            "action": "update"
        },

Workaround:

When I try to add any character to value of parameter value everything work as aspected. Let's add space as prefix. It might not be working solution for some cases:

    "adf-dev": [
        {
            "name": "$.properties.globalParameters.environment.value",
            "value": " $Env:env",
            "action": "update"
        },
NowinskiK commented 1 year ago

Thanks, I will check that in spare time.