Source code migration from TFS 2013 to Azure Devops service - azure

Please suggest if someone has experience of migrating source code of 3-4 applications (including their dev, stage & production environment) from TFS to Azure Devops into Git repository & then build the CI/CD pipeline. We don't require work items or history to be migrated.
Can someone give high level steps & what would be approach for migration?
On premise TFS service is TFS 2013 & source code is to be migrated to Azure Devops services. Currently they are using TFVC. Also these are .net applications. One of the application is having around 9.5 GB of data to be migrated. Kindly advice the process and tools which could help with code migration.

Since you are working on TFVC, you need to use a third-party tool GIT-TFS.
The Git-TFS tool is a two-way bridge between Team Foundation Version Control and Git, and can be used to perform a migration. Git-TFS is appropriate if you want to attempt a migration with full history, more than the 180 days that the Import tool supports, or if you want to attempt a migration that includes multiple branches and merge relationships.
You simply need to go through the following five steps to migrate your TFCV repo to Git.
Step 1: Install git-tfs. There are multiple tools to migrate from
TFVC to Git. ...
Step 2: Export to local Git Repo. ...
Step 3: Cleanup New Git Repository. ...
Step 4: Create new Git Repo in TFS. ...
Step 5: Initial Commit to Git Repo.
More details please take a look at this blog-- Migrate From TFVC To Git – 5 Simple Steps

Related

Netsuite - SuiteCloud Development Framework - GitHub Integration - CI/CD

We are improving our CI/CD process and we understand that we need to use GitHub (or similar) for a better version control..
We would like to integrate SuiteCloud with Github to upload ALL our objects in order to track an monitor any changes. Also, we are planning to use branches to deploy code in our instances. Ex: Master = Production. Dev Branch = Sandbox1, Homologation = Sandbox2.
So... is possible to do it? And how? Any experiences to be shared?
Since SDF manipulates text (xml) files their management is no different than for any other git based CI/CD process.
Netsuite has java and node based CLI tools that can be incorporated in Git Actions for automated deployments.
You'll have some fun if you want to automate testing as that can be problematic with any live database.

Azure Pipelines best practices for multiple services and environments

I was hoping to get some feedback on using Azure Pipelines and what the best practices are for my situation.
We have recently migrated from TFS 2017 and we are in the process of re-writing all our pipelines. We were using builds and releases prior to the upgrade in the legacy build tasks. We would like to setup more useful YAML pipelines.
Let me set the stage with what we currently have
10+ microservices
10 individual builds that trigger from a folder in the repo for each one
10 releases that get created on successful build
3 environments per release (Dev, QA, UAT)
So in summary... a build of a single microservice triggers off of a commit to a folder in the branch. The successful build then triggers a release to Dev. Dev completes and a user go go start a QA build by clicking the release.
In the new Azure Pipeline world... what would be the best approach to doing this model.
We would like to have all the builds happen in a single pipeline (each stage would be a microservice?)
How do we trigger only on a commit to that folder?
What would the CD look like? Should it be in the same pipeline and be a new stage?
How can we easily just add environments without having to just keep copy/pasting all the code for each environment? Ideally i would like to just be able to add a variable and a new environment can be deployed to
I am open to any suggestions here. I am ok if I am way off here, I am looking for the best practices and best approach to this.
TIA

Any way to cache git source files?

There is this great Cache task in Build pipelines. It works great to cache nuget and npm packages (among others), but I don't see a corollary for the git sources.
Is there any way to do this, short of disabling the built in get sources and running our own git checkout as a task? We have a relatively large repo that takes about 3 minutes to sync. I'd like to reduce that if possible. I've already tried using shallow fetch set to a depth of 1, and it hasn't appreciably changed the checkout time.
Azure devops doesnot have this feature of Caching git source currently.
However, if you use self-hosted agent, the git source will be cached on your self-hosted agent machine by default(in the pipeline source code directory. eg. C:\agent\_work\1\s ). Next time when you run your pipeline, it will only checkout the changed files to your local machine.
So you can create a self-hosted agent to run your pipeline. Check here for detailed steps to create self-hosted agent.
(If you want to clean the source code folder each time you run the pipeline. You can set the clean to true for checkout step. clean option of checkout step will not work for Microsoft-hosted agent. Because Each time you run a pipeline, you get a fresh virtual machine. The virtual machine is discarded after one use.)
You can also click here to submit a feature request(Click Suggest a feature and select Azure Devops.
) to Microsoft development team. Hopefully they will consider adding this feature in the future.

Azure can't find my TFS repositories

I have created a new app service on Azure, that i want to connect to an existing project on my TFS.
The problem is, when i choose Continuous Delivery -> Source and selects Visual Studio Team Service and selects the correct project, it says that there is "No repositories found".
What am i missing?
And as you can see, there should be a repository:
It looks to me like you are following the instruction for the new CD services that support Git only: https://www.visualstudio.com/en-us/docs/release/examples/azure/continuous-to-app-service
If you are still using TFVC you may need to follow the old 2013 instructions: https://learn.microsoft.com/en-us/azure/cloud-services/cloud-services-continuous-delivery-use-vso
If you want to move to Git to take advantage of this and other features then you can migrate using the Git-TFS tools on GitHub. Or even better, you can start from scratch and ditch binaries...

Automating merge and publish from development to production. Continuous integration

Let's say we have 2 branches: Development and Production
Also we have 2 servers on Azure in different affinity groups.
Is there a way to automate the process so that on person choosing version X that was 'accepted' in development merges code into production branch and publishes to production server ?
Ideally I would want to have a Changset# and set to production that will merge the production branch (with all the required previous changesets) and get published to server.
The chosen changeset does not have to be the latest on development.
Following 4 steps should do it for you:
1) Create a new build definition for Development branch using TfvcTemplate.12.xaml (only available in TFS 2013) as it has post-build script option (see image below).
2) Create a powershell script to merge the changes to branch using tf merge command. You will have to pass the changeset # to the script using Post-build script arguments.
See this URL: http://msdn.microsoft.com/en-us/library/bd6dxhfy
3) When you run the build set the Get Version(see image below) and it will take the changes from that version. After the build is successful it will merge the changes to the production branch using the step 2 above.
4) Create another build for the Production branch and use the link specified in the below answer to deploy the code to azure on check-in to the branch.
Can I automatically update a live site after each commit using TFVC and Azure?
You can also look at InRelease (link below) for Release Management and automation (not supported for Visual Studio Team Services yet)
http://www.visualstudio.com/en-us/explore/release-management-vs.aspx
Hope it helps.

Resources