1
votes

I have pipelines in Azure DevOps working with Windows Self hosted agent, I currently get source code from external Git but I also need to get source code from internal TFS 2018 server.

I created a service connection, I saw that I can specify it as an Azure subscription name in tasks that deploys but I can't see how to get source code, I have this UI when I create a YAML pipeline but there is not either any TFS option in classic mode:

enter image description here

Should I have a Service or TFS option in there ? Thanks.

2
How about the issue? Does the answer below resolved your question, If not, would you please let me know the latest information about this issue?Walter
Sorry, I had to stop working for few days, I don't fully have my answer, I will explain in each answers.ClaudeVernier

2 Answers

0
votes

You can create a service connection named other git and use this service connection to get source code from TFS 2018. Here is my sample:

  1. Create a Personal access token in TFS 2018.
  2. Create a service connection named other git. The Git repository URL is the URL when you open the TFS 2018 repository.

If you are using git as source control, the format of the URL is http://{server:port}/tfs/DefaultCollection/_git/{repo name}

If you are using TFVC as source control, the format of the URL is http://{server:port}/tfs/DefaultCollection/{project name}/_versionControl or http://{server:port}/tfs/DefaultCollection/{project name}

Please enter the Personal access token you created in the Password/Token filed.

enter image description here

3.Create a pipeline and choose other git as source. You can choose an already created service connection or create a new one. enter image description here

Now you can use the repository in TFS 2018 as the source of this pipeline.

1
votes

Here is the approach if you are looking at TFVC:

  • Go to project settings --> Repositories --> Create Repo. Select TFVC enter image description here

  • After you create the TFVC repo, from the build you should be able to find the option: enter image description here