0

I have below variables.

variable            value
stage                dev
admin                $($(stage)-admindata)
dev-admindata        4000

But these multiple substitutions are not working for variable admin.

Please let me know how to solve this.

admin values should be 4000 when I use it in yaml or in json file, Currently I am getting $(dev-admindata)

sumit salunke
  • 125
  • 2
  • 10

1 Answers1

0

At this moment, the value of nested variables (like $($(stage)-admindata)) are not yet supported in the build/release pipelines.

If you want to give different values to the admin variable depending on the value of stage varibale. As a work around you can write a script in the powershell task to judge, e.g. If the value of the stage variable is dev, then assign the value of the dev-admindata variable to the admin variable.

     if ($(stage) -eq "dev"){
       $admin = $(dev-admindata)
     }
     else{
       xxxxx
     }

For the similar issue ,you can refer to this case.

Hugh Lin
  • 17,829
  • 2
  • 21
  • 25
  • We don't want this in condition, if nested variables are not yet supported in pipelines then is there any other way so, if we can handle this in YAML or in JSON file. we are using replace token task – sumit salunke Oct 23 '19 at 11:35
  • Through testing, it seems that nested variables are also not supported in yaml. – Hugh Lin Oct 25 '19 at 10:03