Recently we’ve been asked by several people if it is possible to integrate between Azure DevOps/VSTS (Visual Studio Team Services) source code management and GitLab. They are looking for a modern CI/CD solution like GitLab, but as part of a gradual transition they still need to keep managing their code in Azure DevOps/VSTS. Although we of course recommend using GitLab CI/CD together with our built-in GitLab SCM, this integration of Azure DevOps source code management and GitLab makes it possible to migrate slowly from Azure DevOps by leaving your code in the Azure DevOps repository while you adopt GitLab CI/CD. This integration is possible with both the self-managed and SaaS versions of GitLab. The integration works only with Azure DevOps/VSTS git version control. TFVC (Team Foundation Version Control) isn’t supported.

In GitLab, there are two features that enable this integration:

GitLab CI/CD for external repositories

Remote repository mirroring

How to set up the integration

  1. Create a new project in GitLab by clicking the New Project buttonCreate new project

  2. Choose the ‘CI/CD for external repo’ tab, and click on Repo by URL.CI/CD for external repo

  3. Open your repository in Azure DevOps and click CloneGetting clone url

  4. Copy the URL. If your repository is private, you will need to generate Git credentials – just click this button and copy the username and password.Credentials

  5. Paste the URL in GitLab under the Git repository URL, give it a name, set the visibility level, and click create project. Add the username and password in case your Azure DevOps repository is private. Note: The repository must be accessible over http://, https:// or git://. When using the http:// or https:// protocols, please provide the exact URL to the repository. HTTP redirects will not be followed.Create project form

  6. Your project is now successfully Mirrored to GitLab. Now branches, tags, and commits will be synced automatically to GitLab.

  7. To configure a CI/CD pipeline there are two options:

Before pushing your first commit, open the CI/CD settings in GitLab and enable Auto DevOps. It will set the CI/CD configuration, so each commit in Azure Repos will trigger a CI/CD pipeline in GitLab which will build, test, and deploy your app.

#devops

How to integrate Azure DevOps repositories with GitLab
50.10 GEEK