Skip to content

Tips about using both Azure DevOps and GitHub together for SQL Server deployments

Reading Time: 3 minutes

I want to share some tips about using both Azure DevOps and GitHub together for SQL Server deployments in this post. So that they help others.

Just a quick recap. In a previous post here, I showed how I deployed SQL Server updates in Azure DevOps. Followed by the repository synced over to GitHub.

After the sync had finished a GitHub Actions workflow started which would deploy another SQL Server update. Using exactly the same dacpac that did the updates in Azure DevOps.

I think these tips will be very useful for some of you.

Workflows folder

First of all, the structure for the workflows used for GitHub Actions is ‘.github\workflows’. If you browse within your local repository using Windows Explorer you will see the ‘.github’ folder with ‘workflows’ as a subfolder.

Tips about using both Azure DevOps and GitHub together for SQL Server deployments
How the folder structure looks in explorer

However, in both Azure DevOps and GitHub they are shown as one structure called ‘.github/workflows’. As per the below examples.

Tips about using both Azure DevOps and GitHub together for SQL Server deployments
How structure looks in Azure DevOps

Tips about using both Azure DevOps and GitHub together for SQL Server deployments
How folder structure looks in GitHub

In reality though they are still in the ‘.github’ folder with a ‘workflows’ subfolder, as shown above. So, please don’t panic.

Azure DevOps organization

If you are thinking of doing this or something similar at work there is another thing that I highly recommend. Which is to create your own personal Azure DevOps organization to test things in.

You can read how to do that in detail here. In addition, you to change the name of your organization afterwards. Just be aware that when you go to demo Azure DevOps to others this organization name can be seen.

Unit testing

If you are looking to do unit testing at the start of your pipeline I highly recommend using tSQLt. Which I talked about in a previous post here.

If looking to implement tSQLt for testing SQL Server databases Sander Stad has some good resources you can use. You can read more about his useful offerings in GitHub in detail here.

Git

My next tip is about Git. If you are going to synchronize Git repositories between different services make sure you have a good understanding of it. Especially as far as dealing with authentication settings and syncing to other repositories are concerned.

Branching strategy

Another thing I recommend doing is to edit your pipelines in a separate branch first to test them. Whether that’s for your pipeline updates in Azure DevOps or your workflow updates GitHub Actions.

Especially if you intend to update files in Azure Data Studio to start with to have a complete flow.

Because editing your files within Azure DevOps and GitHub provides you with an interactive experience. Which even though are both similar have some slight differences.

Final word

I hope you enjoyed reading my Tips about using both Azure DevOps and GitHub together for SQL Server deployments.

Published inAzure DevOpsDevOpsGitHub Actions

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *