How can an Azure pipeline get code from intranet TFS 2018

367 views Asked by At

I saw several pages on Internet but none that explains how to do this. I have Azure Pipelines, a Windows self-hosted agent and an intranet TFS 2018 Server.

I tried to create a “New Azure Repos/Team Foundation Server” service connection with a full access PAT and got this message: “Failed to query service connection API: 'https: //tfs…/defaultcollection/project/_admin/_services/_apis/projects'. Error Message: 'A task was canceled.'” However, I am not even sure this is what I need.

I want a build pipeline to trigger when developers checks-in in VS2019 for a project in TFS. This pipeline would get the code on the agent, build and create an artifact on Azure Artifacts. A release pipeline would take that artifact and deploy on our intranet servers.

Is that possible?
If yes, could you help me find what must be done in Devops and on the TFS servers? If not, could you please tell me the best way to do the above? Many thanks

1

There are 1 answers

1
LoLance On

When you create a "New Azure Repos/Team Foundation Server" service connection, you can try to choose Save without verification.

If you want to check in in VS2019 to trigger a build pipeline, then you need to find the Triggers tab in the build pipeline interface, and then enable continuous integration, add Branch filters.

enter image description here

You can install extension TFS artifacts for Release Management in your organization. With this extension, you can deploy artifacts from external TFS. When you add an artifact, select External TFS build, and then add the required information, you can deploy the artifact to your Internal service

enter image description here

You can get the projectId by calling the REST API below:

REST API : https://learn.microsoft.com/en-us/rest/api/azure/devops/core/projects/list?view=vsts-rest-tfs-4.1

Extension TFS artifacts for Release Management: https://marketplace.visualstudio.com/items?itemName=ms-vscs-rm.vss-services-externaltfs