in BuildTasks/Common/Common.ts [261:284]
export function setTfxMarketplaceArguments(tfx: ToolRunner, setServiceUrl = true) : void {
const connectTo = tl.getInput("connectTo", false) || "VsTeam";
let galleryEndpoint;
if (connectTo === "VsTeam") {
galleryEndpoint = getMarketplaceEndpointDetails("connectedServiceName");
tfx.argIf(setServiceUrl, ["--service-url", galleryEndpoint.url]);
tfx.arg(["--auth-type", "pat"]);
tfx.arg(["--token", galleryEndpoint.password]);
} else {
galleryEndpoint = getMarketplaceEndpointDetails("connectedServiceNameTFS");
tfx.argIf(setServiceUrl, ["--service-url", galleryEndpoint.url]);
if (galleryEndpoint.username) {
tfx.arg(["--auth-type", "basic"]);
tfx.arg(["--username", galleryEndpoint.username]);
tfx.arg(["--password", galleryEndpoint.password]);
}
else {
tfx.arg(["--auth-type", "pat"]);
tfx.arg(["--token", galleryEndpoint.apitoken]);
}
}
}