Skip to content

Download a Microsoft Fabric Data Warehouse database project to perform CI/CD using Azure DevOps

Reading Time: 5 minutes

In this post I want to cover how you can download a Microsoft Fabric Data Warehouse database project to perform CI/CD using Azure DevOps.

In addition, how my example AzureDevOps-FabricDWDBProject GitHub repository can help you speed up the process.

Which is now easier to do. Thanks to the latest option in the Warehouse Editor that allows you to download a SQL database project that contains a schema of your Data Warehouse locally.

Option to download SQL database project based on a Microsoft Fabric Data Warehouse
Option to download SQL database project

To help with some jargon, a database project is basically the schema of your database represented as code. Initially introduced for SQL Server developments they can now work with other items such as Azure Synapse SQL Pools and Microsoft Fabric Data Warehouses.

I decided to do this post because my LinkedIn post about this option was so popular.

By the end of this post, you will know how to download the SQL database project and use it within Azure DevOps. Plus, I will show you how my example AzureDevOps-FabricDWDBProject can help when you are looking to do this.

Along the way I share plenty of links. To manage expectations, I share links in previous posts to avoid heavy repetition.

Before I get started I want to highlight that in order to follow along with this post you need to create a new Git repository within the Azure Repos service in Azure DevOps.

Downloading a SQL database project based on your Microsoft Fabric Data Warehouse

To download the SQL database project, you must go open your Data Warehouse in Microsoft Fabric and click the “Download SQL database project button”.

When you do this for the first time you will get a window appear explaining what this button does. As you can see below.

Download SQL database project window
Download SQL database project window

Anyway, once the zip file has been downloaded you can extract it to a location where you want it stored. Once the files are in the right location that you can initialize the folder to be a Git repository.

In reality, you can do this with various applications. For this example I use Azure Data Studio along with the SQL Database Projects extension.

Just a quick tip, to quickly open up a folder in Azure Data Studio you can run the below command in PowerShell.

AzureDataStudio {relative folder location}

You can then navigate to the “Database Projects” option in Azure Data Studio to check that it recognizes the database project properly.

Checking the Microsoft Fabric database project is valid
Checking the database project is valid

From there, initialize the repository and synchronize it with one in Azure DevOps. I covered how you can do this in detail in the below sections of a previous post about how to create a dacpac for an Azure Synapse Analytics dedicated SQL Pool using Azure DevOps.

  • Create Git repository for SQL Pool in Azure DevOps
  • Synchronize Azure Synapse SQL Pool repository to Azure DevOps

In reality, you can follow the above steps because the only difference is that you synchronize a database project for a Microsoft Fabric Data Warehouse to Azure Repos instead.

Afterwards, you can look to add a YAML pipeline to the repository. For this example, the one I make available in my AzureDevOps-FabricDWDBProject repository.

Adding my YAML pipeline to the Git repository containing the database project

It is suffice to say there are various ways you can get the YAML pipeline from my AzureDevOps-FabricDWDBProject repository. For the benefit of this post, I will show what I consider to be the easiest way for this example.

First go into ‘Pipelines’ in Azure DevOps and select the ‘New pipeline’ button. From there, select Azure Repos Git since that is where the Database Project is stored.

Selecting Azure Repos Git
Selecting Azure Repos Git

Afterwards, select the Git repository that contains the database project. Once done select “Starter pipeline” as below.

Configure your pipeline
Configure your pipeline

Doing this creates an initial YAML pipeline for you to work with.

In another browser tab navigate to my AzureDevOps-FabricDWDBProject repository in GitHub. From there, open up the “FabricDWProject-sqlpackage-install-first.yml” file in the “AzureDevOpsTemplates” subfolder.

Once the file is opened copy and paste the contents into your new starter pipeline in Azure DevOps. Overwriting the text that is there.

At this point the top of your YAML pipeline should look like the below example. Where it shows recommended variables to create for the YAML Pipeline at the top.

YAML pipeline to perform CI/CD for your Microsoft Fabric Data Warehouse database project in Azure DevOps
YAML pipeline to perform CI/CD in Azure DevOps

At this stage I recommend selecting the down arrow next to “Save and run” and just select “Save” instead. So that you can create the “FabricDW” variable group mentioned in the pipeline and add your own values before you look to run the pipeline.

Of course, you can also just change what you see fit depending on your comfort zone.

You can find out more about this YAML pipeline and the expected outcome in my other post that covers CI/CD for Microsoft Fabric Data Warehouses using YAML Pipelines.

Microsoft Fabric and Azure DevOps session

If you live in Europe, you can watch me present more about working with Azure DevOps and Microsoft Fabric together at Data Point Prague. Where I cover how you can prepare Azure DevOps for your Microsoft Fabric needs.

You can find out more about Data Point Prague by either clicking on the above link or on the below image.

Data Point Prague session
Data Point Prague session

Final words about downloading a Microsoft Fabric Data Warehouse database project to perform CI/CD

I hope this post has inspired you to test downloading a Microsoft Fabric Data Warehouse database project to perform CI/CD using Azure DevOps. Because the new option to download a SQL database project can help a lot of you.

Plus, I hope this helps some of you realize how my AzureDevOps-FabricDWDBProject repository can help you get up and running with CI/CD for your SQL database project faster.

Of course, if you have any comments or queries about this post feel free to reach out to me.

Published inAzure DevOpsMicrosoft Fabric

5 Comments

  1. Linford Akwei Linford Akwei

    Hi Keven, great blog post about ci/cd and fabric warehouses. How do you deal with schema changes on the warehouse site? As you know it is not possible to do alter statements on warehouses. This means we should always drop and recreate warehouse tables. But what if you don’t want to delete the data from your warehouse tables? How do you deal with this?

    • Kevin Chant Kevin Chant

      At this moment in time your only option would be to add additional tables use views if you wanted to perform CI/CD still. Either that or look to work with combination of Lakehouses and Warehouses for long-term data retention needs.

Leave a Reply

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