function getconnection()

in code-diff-coverage/UpdateBuildProperties/index.js [15:33]


function getconnection() {
    return __awaiter(this, void 0, void 0, function* () {
        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;
    });
}