0

I'm new to VSTS Extension and typescript. We have a requirement to read the configuration file from Local Machine/ or UNC path in VSTS Extension.

Data Storage (https://learn.microsoft.com/en-us/vsts/extend/develop/data-storage ) was not helpful as its not stored as a physical file. Since each user has their own configuration file we need to read it from their local machine.

Can anyone let me know whether it is feasible? (with some code samples) Thanks in advance.

Siva
  • 13
  • 4

1 Answers1

-1

You can store the path in the build/release variable or system/user variable in agent machine, then you can get the value from process.env.[variable name].

For example, add a variable (e.g. myconfig) in build/release definition), then print the value with this code below in task extension:

console.log(process.env.myconfig)

You also can include a input box in build/release task, then let user to specify the path in task, after that you can get the value through task.getPathInput method.

For example:

import tl = require('vsts-task-lib/task');
var configPath=tl.getPathInput([name])
starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53