Reputation: 526
Hello Stackoverflowers,
I have been playing lately alot with the CI-CD on VSTS with GIT. I have a set of Build tasks which refer to secure files. I use the „Download Secure File“ task to access these files at build time. However, I was wondering if there is a way to commit these files or at least automatically update them from my dev environment. For now, these files need to be uploaded manually, which is wrong. Thanks
Upvotes: 1
Views: 1688
Reputation: 183
You can use API to delete and upload secure file in library.
For secure file delete use PUT API
https://dev.azure.com/{organization}/{project}/_apis/distributedtask/securefiles/{secureFileID}?api-version=5.0-preview.1
And for secure file upload use POST API https://dev.azure.com/{organization}/{project}/_apis/distributedtask/securefiles?name={fileName}&api-version=5.0-preview.1
Content-Type=application/octet-stream
Upvotes: 1
Reputation: 38106
For now, there is no way to update secure files automatically. You need to upload the secure files manually.
While when uploading a secure file name which already exists, you need to deleted the existing one and add the new one with the same name.
And there has the user voice Allow us to update an existing Secure File instead of having to delete and re-upload which suggests this feature, you can vote and follow up.
Upvotes: 1