Reputation: 1794
I'd like to better understand the order the TFS/VSTS Build & Release Variables are evaluated. There are Release-Definition, Environment-Definition, and Variable-Group Variables. You can even set variables in the middle of a script execution.
I can't find anywhere in the Microsoft docs. Which variables are evaluated first. If one variable references another, do they automagically know their own dependencies, or are they dumb variables that get their values in the order they're defined?
Upvotes: 1
Views: 414
Reputation: 38136
Variable group: share values of all definitions across the team project.
Release definition variables: share values of all the environments across the release definition.
Environment variables: share values of all the tasks across the release environment.
Set variables by script: it will change the values of variables for the following tasks of current environment.
Set variables by script > environment variables > release definition variables > variable group.
That means:
If you change the value of a variable by script, the changed value will be used in the following tasks of current environment.
If you define a environment variable which still exist in release definition variables or variable group, the environment will use the value defined in environment variables.
If you define a release definition variable which still exist in variable group, the environments will use the value defined in the release definition variables.
Upvotes: 1