beverts312
beverts312

Reputation: 65

How do I set an environment variable at build time on a VSO Hosted Build Controller?

How can I set an environmental variable on a VSO Hosted Build Controller at build time? An ideal solution would be using MSBuild arguments.

Scenario (not necessary to know): I am trying to get an Orleans based Azure Hosted Cloud Service to build and deploy using a VSO Hosted Build Controller. Currently I am hosting my own build controller using TFS however we would like to use the VSO hosted build controller. In order for this to work I have to set the Orleans Environmental Variable to a path within my project on the VSO Hosted Build Controller at build time. We are using a continuous deployment model.

Upvotes: 1

Views: 1039

Answers (1)

beverts312
beverts312

Reputation: 65

The MSBuild Arg is

/p: EnvVarName = PathAsAString

It can be the full path(p:OrleansSDK="C:\a\scr\Main\Lib") or the relative path(/p:OrleansSDK="..\..\Lib"), depending on the build process template it might be able to include existing variables (p:OrleansSDK="$(SourcesDir)\Lib").

Upvotes: 1

Related Questions