Is there a way to do nested variables in VSTS Release Management

Viewed 1929

I have a few variables created in Variable Groups with the following names:

CodeNetworkShare.Dev
CodeNetworkShare.Test
CodeNetworkShare.Prod

I imported this variable group in my Release Definition. Then I tried the following ways to use this in Release definition

  1. I created a local variable in the Release Definition as follows:

    Name = CodeNetworkShare1 Value = $(CodeNetworkShare.$(Release.EnvironmentName))

  2. I tried to use it directly in the task using the following expression:

    $(CodeNetworkShare.$(Release.EnvironmentName))

Neither of the above approaches worked. Is there any other way I can get this to work? Does VSTS Release Definitions nested variables? If it's not supported at the moment are there plans to support this in the future?

3 Answers

VSTS now has the option of linking variable groups to different environments within the same release definition. Create separate variable groups for each environment (dev, test, prod, or maybe just dev and prod, if e.g. test is in production environment) and then link that group to correct environments in the link page. See more in my other answer here: Is there a way to use VSTS Variable Groups per environment?

Related