In the vNext Release Templates there are few ways to pass parameters/configuration variables to a PS/DSC Script. Variables in five different levels can be used for this.
Global Variables – Defined at the Release Management Server level in Administration – > Settings – > Configuration Variables.
Server Variables – Defined at the Registered Target Server level in Configure Paths –> Servers –> Server –> Configuration Variables. The values defined in Server Variables will override the values of the variables defined in Global Variables.
Component Variables – Defined at the Release Component level in Configure Apps –> Components –> Component –> Configuration Variables. The values defined in Component Variables will override the values of the variables defined in Global and Server Variables.
Action Variables – Defined in the Release Template, Deploy Using PS/DSC action in Configure Apps –> vNext Release Templates –> vNext Release Template –> Deploy Using PS/DSC. The values defined in Action Variables will override the values of the variables defined in Global, Server and Component Variables.
All above four levels of Configuration Variables are supported with encrypted value by selecting the type Encrypted.
These variables can be managed in the release template using Configuration Variables and Resource Variables.
Variables in Configuration Script File - These variables will be defined in a configuration script file and should be available with the build output. These files will allow to source control configuration variables for each stage. There is no encryption for the variables defined in a script file. The values defined in Script File Variables will override the values of the variables defined in Global, Server, Component and Action Variables.
Passing Action Variables
To pass the Customer Name to the below script Action Variable can be used.
This script should be available in build output.
Component Should be setup to download the script to target server.
In the Deploy Using PS/DSC action the configuration variable CustomerName can be set like below.
When release triggered the scripts get downloaded to target server.
The value passed for CustomerName can be verified in the log.
Passing Component Variables
When component variable is only set it is getting passed to the script.
Action Variable Value Overriding Component Variable Value
When both Component and Action variable values set action variable value gets the precedence.
Setting Variables Using Script File
Configuration Variables can be set using a Script File as well.
This configuration variable script file should be available in build output.
When release triggered configuration variable script file is also copied to the target server.
Release PS/DSC script uses the configuration variable value defined in the configuration script file.
Script File Values Overriding Action and Component Variable Values
When value is defined for configuration variable in Component, Action and in a Configuration File the Configuration File get the precedence.
Resolve MSB4019: The imported project "C:\Program Files\dotnet\sdk\1.0.0-rc4-004771\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was not found or Unable to start the process. No executable found matching command "dotnet-projectmodel-server"You might encounter compilation error in Visual Studio 2015 when a new .NET Core 1 web app is created, if you have installed Visual Studio 2...
This extension “ Chamindac.vsts.release.task.download-artifacts ” for VSTS and TFS 2015.2.1 upwards, can be used to filter for build artifac...
It is great if the latest updates to TFS can be applied as and when they are released. But for a large organization it might not be sometime...
There was a question from a team member how to bulk edit TFS work items. In the past the only answer to this question would be use excel. Op...
Let’s look at steps required for Setup Test Farm, Start and Stop, and Test Clients for Test Execution for setting up a Test Farm as Azure VM...