In this post I want to cover how you can share a Microsoft Fabric Data Warehouse Database Project with the new target platform.
Important note: Shortly after this post was published the same functionality was released in the GA version of Azure Data Studio.
I covered the fact that the new Microsoft Fabric Data Warehouse Target Platform is now included as part of the latest Azure Data Studio update in a newer post. However, the contents of this post still apply when it comes to sharing the project and deploying the dacpac, so enjoy.
Creating the Microsoft Fabric Data Warehouse Database Project
To show this working, I decided to create a Database Project based on an existing Data Warehouse in this post. So, I created a new one that contains a few objects. As you can see below.
Next, I went into the latest version of Azure Data Studio insiders. Which has the latest version of the SQL Database Projects extension installed (v1.3.1).
I go to the connections section and setup the connection to the Data Warehouse. Once done I right click the Data Warehouse and select ‘Create Project From Database’ to bring up the wizard.
Once done I have a populated database project.
However, that is not all. If I open up the sqlproj file for it, I can see that the Database Schema Provider (DSP) setting is below.
Which means there is a new target platform. In fact, when I go to manage the database project and select ‘Change Target Platform’ I see two new options towards the bottom. One for serverless SQL Pools and another for Microsoft Fabric Data Warehouses.
In this post I focus on the new Microsoft Fabric target platform at the bottom.
Anyway, one interesting observation is that the name of the Database Schema Provider (DSP) shown above within the sqlproj file is different from what is shown in the wizard.
Once that is done, I initialize the repository in the source control section and done an initial commit. Just like I covered in my previous post about Git integration tests for Power BI reports.
I then created a new Git repository in Azure Repos within Azure DevOps.
I then synchronized this repository with my local one. Just like I have covered in previous posts. Once done my repository was ready for use.
I then created another branch to work with called Feature. In addition, I added the below line to the sqlproj file so that it would work with a newer .NET framework.
Sharing and deploying updates using the Microsoft Fabric Data Warehouse Database Project
You can share this repository for others to work with and deploy to other Data Warehouse. Because if they have the latest Azure Data Studio Insiders update they can deploy the contents of the Database Project to another Microsoft Fabric Data Warehouse.
I tested this by going into the Database Projects in Azure Data Studio Insiders, right clicking the project and selecting ‘Publish’.
In the ‘Publish Project’ screen I clicked on the service connection icon to connect up to the new Microsoft Fabric Data Warehouse.
Once Azure Data Studio Insiders informed me that the deploy dacpac had succeeded I went back into Microsoft Fabric. Where I could see my new objects.
Just be aware that if you do this two new folders will be created in your repository folder. So, you might want to delete the ‘bin’ and ‘obj’ folders before you synchronize your project with Azure DevOps.
Deploying the Microsoft Fabric Database Project with Azure DevOps
In addition, I tested deploying the Microsoft Fabric database project with Azure DevOps. Using the same method as previous posts.
First, I tested creating a dacpac by building the database project and deploying it. Because it is an SDK-style database project I used a .NET core task instead of Visual Studio build task in Azure Pipelines.
steps: # First build the project - task: DotNetCoreCLI@2 displayName: 'Build the dacpac using dotnet' inputs: command: 'build' projects: 'FabricDWProject.sqlproj' arguments: '--configuration $(BuildConfiguration)' #Then publish it as part of artifact - task: PublishBuildArtifacts@1 displayName: 'Publishes dacpac as an artifact' # Publishes the dacpac as part of an artifact within Azure DevOps inputs: PathtoPublish: 'bin\$(BuildConfiguration)' ArtifactName: $(SQLPoolartifactname) publishLocation: 'Container'
This worked fine, so I created a new Data Warehouse in a new workspace. I then tried to deploy the dacpac to the new Data Warehouse. However, I kept getting the below error.
The database platform service with type Microsoft.Data.Tools.Schema.Sql.SqlDwUnifiedDatabaseSchemaProvider is not valid
So, it looks like you will have to wait until SqlPackage is updated to support the new target platform using this deployment method. Or look for an alternative solution.
I hope this post on how you can currently share a Microsoft Fabric Data Warehouse Database Project with the new target platform.
It looks like at this moment in time the best option to share a Database Project with the new Target Platform is to share in central repository and use the latest version of Azure Data Studio Insiders for deployments.
At least until other applications like SqlPackage are updated. Which will introduce more interesting CI/CD possibilities.
Of course, if you have any comments or queries about this post feel free to reach out to me.