1

I have a multi-configuration web application I'm using parallel deployments, leveraging Task Groups for reusing my deployment code.

I've been using Powershell tasks and the ##vso[task.setvariable variable] but those only are readable by other tasks (particularly non-PowerShell tasks) if they correspond to top-level variables at the Build/Release level. Variables that are only local to the task-group.

Basically, the behavior described in Issue #3116

Does anybody have a better workaround for this issue besides binding all your variables right to the root with identical names?

Richard Slater
  • 11,747
  • 7
  • 43
  • 82
Pxtl
  • 111
  • 3

1 Answers1

1

I'm not sure my approach is any "better". However, what I have done in the past was to use Table Storage or Cosmos DB to store the key-value pairs that needed to be persisted between each stage.

The general schema was:

  • Key: buildNum-variableName
  • Value: variableValue

I then created various wrappers for the SDK to access from PowerShell and MSBuild, this also enabled chaining multiple builds together to create a CI/CD pipeline.

Richard Slater
  • 11,747
  • 7
  • 43
  • 82