I've set up 3 environments (Debug, Stage & Production) and created a custom variable named testVariable
for each environment within the RELEASE tab of my Visual Studio Team Service project as shown here:
I also have a release variable named testReleaseVariable
shared by all the enviornments as shown here:
I can't find any documentation on how to set up my ASP.NET projects in VS to use these variables when developing locally as well as when deploying a build so that they can be injected by the Release Manager.
I have both ASP.NET 4.5 as well as ASP.NET 5.0 projects. My question is: What is the best practice for setting up my Web.Config (for ASP.NET 4.5 projects) or my Config.json (for ASP.NET 5 projects) to work with both the enviornment as well as the release configuration variables in VSTS Release Management.
The configuration variables can be used in any of the Tasks.
You can use the configuration variable by using the $(configVarName) in any of the tasks.
Note that directly you can use these variables only in the tasks not inside the files like Web.Config.
To use them inside files and replace them with appropriate values, you can use the Tokenizer Task.
More info is available at this blog post
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With