Remote TFS 2015 to Azure Devops (private cloud) Migration - tfs

My current organization is having an requirement to migrate source code + history linkages from vendor TFS 2015 which is at remote site to our Azure Devops(Repos). The challenge I am having is that since source TFS is in remote site and not connected by our AD, could not find a way to link it. Currently we are using explict logins to their tfs and getting the code. Is there any possible way to migrate the same and do the synching daily, for few months and unplug the dependency on remote.
Any help would be much appreciated..

Not sure the Azure DevOps(Repos) you mentioned are Azure DevOps Service (prior VSTS) or Azure DevOps Server 2019(prior TFS) In your case, seems you just want to perform a source code synchronization between TFS2015 to Azure DevOps service or Azure DevOps server.
For Azure DevOps Service : When you decide to make the move from Azure DevOps Server to Azure DevOps Services, there are many approaches to doing this which vary in both the fidelity of the data transfer and the complexity of the process.
Option 1: Copy the most important assets manually
Option 2: High fidelity database migration
Option 3: Using public API-based tools for higher fidelity migration
Only the option2 will include source control history during the migration. But it also have some limitation, such as import tool supported version. Currently only the following versions of Azure DevOps Server are supported for import:
Azure DevOps Server 2019 and Azure DevOps Server 2019.0.1
In your scenario, you could use a CI build in TFS2015 to sync the Azure DevOps repo automatically. And the biggest challenge here is the authentication for both TFS and Azure DevOps Service. Just as you mentioned using explicit logins and powershell script should do the work.
A sample for your reference:
1. Create a CI build in TFS 2015
In your TFS 2015 project where the git repo hosted -> create a build definition with the TFS 2015 git repo as repository -> enable CI with all branches included.
2. Add a PowerShell task to sync TFS2015 git repo to Azure DevOps Service Add a PowerShell task in the build definition with below script:
if ( $(git remote) -contains 'vsts' )
{
git remote rm vsts 2>&1|Write-Host
echo 'VSTS Account removed'
}
git remote add vsts https://Personal%20Access%20Token:{PAT}#{account}.visualstudio.com/{project}/_git/{repo}
git checkout ${env:BUILD_SOURCEBRANCHNAME} 2>&1|Write-Host
git reset --hard origin/master 2>&1|Write-Host
echo 'update local branch with remote successfully'
git push vsts ${env:BUILD_SOURCEBRANCHNAME} -f 2>&1|Write-Host
Note: the vsts remote should be added with credential. And it uses PAT for authentication in the Azure DevOps Service git repo URL. And you just need to replace the real PAT, accountname, projectname and reponame in the URL https://Personal%20Access%20Token:{PAT}#marinaliu.visualstudio.com/{project}/_git/{repo}.
Save the build definition, and now when any branches are updated in TFS 2015 git repo, VSTS git repo will be synced automatically for the corresponding branches.

Related

How integrate pull request Azure Devops Repository With Jenkins

I have a Git repository on the Azure Dev-ops server and use Jenkins for continuous integration build.
I want to know that how a specific branch like master Jenkins can automatically run the build and then notify the user via a shell log that the build was successful or not?
Microsoft seems to have the thing pretty well documented, Create a service hook for Azure DevOps Services and TFS with Jenkins
Set up the Jenkins job, set up the TFS / Azure DrevOps ServiceHook, off to the races.
We have it working fine for Jenkins 2.x and AzureDevOps on-prem. Best to use service accounts with limited necessary permissions on both sides.

##[error]Git fetch failed with exit code: 128

We have a Git repo on TFS and I am trying to create a pipeline using azure pipelines to connect to the TFS repos.
I get the following error:
fatal: unable to access 'http://tfs.****************': Could not resolve host: tfs.******
##[error]Git fetch failed with exit code: 128
I would suggest you first use "git clone" command line to clone remote repo.
Kindly check when you run it manually from the build agent, it work for that repo or not.
This will narrow down if the issue related to your environment or pipeline.
If you are able to use git command to connect and clone that repo.
This means there is something wrong with your build service
account. You should make sure build service account has access to that
repo. You could also directly change the service account to the one
you used to run git command.
If you are not able to do it. Then this may related to network
environment. Make sure your build agent are able to access TFS
on-premise server. Temporarily turn off firewall and any proxy. Also
try to directly use browser to login TFS web portal.
It seems that it is a self-deployment of TFS server then you need to make sure that the Server can be reached from Azure DevOps.
Based on URL in your post, I assume server is not reachable from public internet. So TFS server should be either on-prem or on a VM in Azure. So reach out to your infrastructure team to see where the server is, and how the connection could be established from build agent being used by Azure DevOps to the TFS server.

bitbucket and TFS - any 3rd party opensource tools to connect or integrate between these 2 repositories

Currently my On-premise company is using Team Foundation Server (TFS), it is doing multiple things like work tracking and build.
We brought Bitbucket to separate code repository, we still want to continue using TFS for work tracking. We are looking for any (opensource project examples) connectors or integrators or plugins somewhat similar to connect between Bitbucket & TFS . If there is any opensource project examples to connect these somewhat similar will try to tweak it.
Azure Pipelines, Azure DevOps Server, and TFS integrate with a number of version control systems. When you use any of these version control systems, you can configure a pipeline to build, test, and deploy your application. Please check Supported source repositories of Azure DevOps Server/TFS.
Bitbucket Cloud repository type is supported in Azure Pipelines, but not in on-premise Azure DevOps Server/TFS. As a workaround, you can use the Other Git or External Git repository type in on-premise Azure DevOps Server/TFS, to build repositories in Bitbucket.

Publish Jenkins build output to Azure Dev Ops for release pipeline

I am looking for how to publish a Jenkins build output to Azure Dev Ops for the purpose of deployment.
All of our code is on TFS 2015 and the build definitions are in Jenkins.
We will be migrating to Azure Dev ops completely, but for now I just want to manage the deployment through Dev Ops. I will script the agent on each of the hosts and move the files to their correct locations.
Looking at the Azure Cli - there Publish Pipeline Artifacts
I can't use a service connection to Jenkins because the server is behind a firewall. I need to be able to publish from Jenkins to Azure Dev Ops.
Any creative ways to do this?
for example, you could create a nuget package (or any other package) from jenkins build and push it to the artifacts feed you create in azure devops. Next is to create a release pipeline with a trigger for Azure Artifacts (with enabled continuous integration trigger) for the latest package version.
here is an example on how to publish nuget packages from jenkins.
EDIT
be aware of the size limitations of Azure Artifacts. As per today, only 2 GB are free of charge.

How can I migrate from GitHub to VSTS with the same Jenkins Pipeline?

Our team is trying to migrate from GitHub environment to Microsoft Visual Studio Team Service environment. However, the GitHub already has a Jenkins pipeline.
I want to use the same pipeline but move it to the VSTS environment.
There are no clear tutorials regarding this issue.
I want to keep the same configuration but make this work for the repository in VSTS Git.
Please help.
You need to create a service hook for Jenkins. That will allow you to trigger Jenkins builds as appropriate.

Resources