Skip to content

Database Version Control in Azure DevOps

Azure DevOps gives you the option to use ‘Git‘, this the same version control system I used in my previous post about adding version control to an SSDT database project. In this previous post I used Bitbucket as cloud Git provider. In this demo I will use Azure DevOps as the cloud Git provider. By the way, you can use Bitbucket in combination with Azure DevOps. I might do a different post on that one day.

Start with Azure DevOps

First, head over to Azure DevOps. You can start a free Azure DevOps environment by clicking the ‘Start free’ button.

You need a Microsoft Account to sign in. If you don’t have a Microsoft Account you can create one while at the login screen after you have clicked the ‘Start free’ button.

Note: If you already started an Azure DevOps environment, you can choose for ‘Sign in to Azure DevOps’.

When you first sign into your Azure DevOps environment you will start with a page where you can define your first project. More on this in the next chapter.

Back to Table Of Contents

Create an Azure DevOps Project

To create a DevOps project you can either use the page from the previous chapter, the page you’ll see when you first create an Azure DevOps account. Also, you can click the ‘+ New Project ‘ on the top right when you are in an Azure DevOps environment that already existed.

You need to enter a project name. I’ll use ‘WideWorldImporters_Demo’.

The project description is optional, you may leave this box empty. When working in a team I suggest you put some lines here describing the project.

Choose ‘Private’ so that only members of this project can see the code. If you like to share your code with everybody on the internet, you should choose ‘Public’.

Additionally you may choose advanced settings, or just hit ‘+ Create project’. Read about the advanced settings in the next paragraphs.

Back to Table Of Contents

Advanced

Version Control System

Under ‘Advanced’ you can choose the version control system. Azure DevOps give you the option to use ‘Git‘ or ‘Team Foundation Version Control‘. I will use Git here in this demo.

Work item process

Azure DevOps not only provides a system for managing CICD pipelines, but it can also be used to control work items in a project and manage different (agile) work processes. Under ‘Advanced’ you are able to choose different kind of work item processes. This post is not about different work item processes, so I stick to ‘Basic’ for this demo. Feel free to explore the differences at your own leisure.

Back to Table Of Contents

Open an Azure DevOps project

When you first create a project, this project will open as soon as you click the ‘+ Create Project’ button. If you created the project in a previous session, you can easily re-open the project from the DevOps main page. Just click the tile with the project name in it, from the Projects-view.

Back to Table Of Contents

Add code to the project repository

A while back, I wrote a post about how to get your SSDT project in source control. The only difference now that I will be using Azure DevOps Git instead of Bitbucket Git. So you need the Azure DevOps url instead of the Bitbucket URL. To get the Azure DevOps URL:

  1. First, click on ‘Repos’ on the left side.
  2. Then, copy (only) the url from the ‘Push an existing repository from command line’

3. Use this URL instead of the bitbucket URL in SSDT project in source control.

Note: Sometimes Visual Studio and the Git credential manager throw errors when adding an Azure DevOps URL. I found that (at least when you have the latest updates from Git and Visual Studio) these errors may be solved when cloning an repository from Azure DevOps. This cloning procedure may help to add the Azure DevOps credentials to the windows credential manager and by adding it there, solve the errors thrown by Git and Visual Studio.

Change to Azure DevOps in case you use another repository

When you have connected the local repository to another remote repository (like bitbucket), you can easily replace the earlier remote settings with the new remote repository in Azure DevOps.

In the Git menu, choose ‘Manage Remote’.

Then select the old remote settings and click ‘Remove’.

Then click ‘Add’, enter ‘origin’ for name and paste the new Axure DevOps URL in the Fetch input.

Click ‘OK’ to save the new settings.

Back to Table Of Contents