in code-diff-coverage/UpdateBuildProperties/index.ts [6:24]
async function getconnection(){
const accessToken = azTask.getEndpointAuthorizationParameter('SystemVssConnection', 'AccessToken', false);
const collectionUri = azTask.getVariable('System.TeamFoundationCollectionUri');
const buildId = azTask.getVariable('Build.BuildId');
const projectId = azTask.getVariable('System.TeamProjectId');
if (collectionUri == undefined){
console.error(`The collectionUri is empty.`);
return undefined;
}
if (accessToken == undefined){
console.error(`The AccessToken is empty.`);
return undefined;
}
var authHandler = azdev.getPersonalAccessTokenHandler(accessToken);
var connection = new azdev.WebApi(collectionUri, authHandler);
return connection;
}