-1

Referring to the link here: https://learn.microsoft.com/en-us/vsts/extend/develop/data-storage.

Does the "documents" for the data storage refers to any file types?

Can we upload files via VSTS extension?

Ie. Is it possible to invoke a server side implementation using aspx or php to store a file inside my extension?

Kah Wai Lee
  • 127
  • 1
  • 2
  • 11

2 Answers2

1

As Jazimov said that you can’t store the files in VSTS extension data storage.

I recommend that you can upload the files to a repository of VSTS through REST API (e.g. Add a binary file) in your VSTS extension, then store the necessary information (e.g. server path, file name, objectId etc) in data storage.

starian chen-MSFT
  • 33,174
  • 2
  • 29
  • 53
0

The Documents object is a collection of Document objects. Document objects are deserialized as JSON objects.

When you ask if "documents" can refer to any file type, the answer is "No". Documents are not files. They start as C# objects that are serialized then persisted to a data store. When retrieved, they are returned as JSON strings.

You can encode a file into your data structure before storing and then the returned JSON will contain your deserialized file information. See Binary Data in JSON String. Something better than Base64 for more details.

The last part of your question: Of course your can invoke a service that uploads and downloads files. You would have to write that code logic on your own--it's not part of an VSTS extension's data-storage subsystem.

Jazimov
  • 12,626
  • 9
  • 52
  • 59
  • Thanks Jazimov for the quick reply. I need the data to be with the same file extension and be stored in a specific folder for other usage. Therefore, storing a Json binary data and retreiving the deserialized data may not be what I am looking for. In regards to invoking a service. Do you mean this? https://learn.microsoft.com/en-us/vsts/git/how-to/create-pr-status-server?toc=/vsts/extend/toc.json&bc=/vsts/extend/breadcrumb/toc.json Is it possible to host the nodejs application to run within VSTS itself? I do not want to host my own application server. – Kah Wai Lee Feb 06 '18 at 15:45
  • Just to highlight that I am creating an in-house TFS (not VSTS) extension in an offline environment as well. Hence using of Azure to host my application might not be feasible as well. – Kah Wai Lee Feb 06 '18 at 15:50