Reputation: 83
I'm trying to understand how we can associate variable groups to a particular environment within a single release definition. It does not appear as though this is currently possible?
As I understand it, in a release definition we can define variables that can be scoped to all or specific environments within that release definition.
We also have the ability to "link" Variables Groups to that release definition. The problem I have is that I would like to create Variable Groups that only get applied to say Production environments and not the non prods within a release definition.
Has anyone been able to achieve something like this? I know this is currently possible in other Release Managers like Octopus.
Thanks in advance.
Upvotes: 2
Views: 758
Reputation: 106
This is now available in VSTS. When linking variable groups you have the ability to link a variable group to the entire release definition or to one or more specific environments.
Upvotes: 3
Reputation: 38096
Based on your description (apply variables only for production environment in a release definition), you should use environment variables instead of variable group.
There are three kinds of variables for release management:
Variable group: the variable scope is works for all the build/release definitions. You can link variable group through variable groups Tab in release definition.
Release variable:
The variable scope is works for the current release definition, and it can be used for all the release environment of the current release definition. You can add release definition through process variables Tab, and set variable scope as Release
.
Environment variable: The variable scope only works of an environment, and it’s not available for other release environment.
You can add an environment variable in process variables Tab, and select an environment as the scope. For your situation, you should set the variable scope as production variable, so that the variable can only available for production environment.
Upvotes: 0