I\'ve a repository hosted on VSTS, containig a file stored through git-lfs. If I just let VSTS build checkout the repository it just downloads the git-lfs metadata file cont
VSTS has now an Allow Scripts to Access OAuth Token option. With this option set on the build definition the OAuth is available to build scripts.
Allow Scripts to Access OAuth Token
I've created an extension containing build tasks which change the remote Url to use the OAuth token to access the remote repository.