'Best way to store SQL scripts and Power BI files in Azure Repos

I would like to know what would be the best way to keep and transfer my SQL Server database scripts (views, trigger, ...) and my files (dataset and reports) from Power BI in Azure Devops/Repo using GIT.

With the .NET environment, I'm used to building an solution (.sln) in Visual Studio 2019 but I'm less familiar with SQL scripts and Power BI files.

I did try to create a Visual Studio solution for my SQL Scripts and put them directly into Azure Repos directly by uploading them in the service. However, when I click back on my files SQL in Visual Studio, I can't see the scripts? It looks like they are not in the right solution/projet format. It doesn't load as usual and visual studio closes. The scripts are in a directory called 'Miscellaneous' in my Visual studio solution.

Maybe I didn't choose the right solution? And if so, which one should I choose and how can I go back in breaking my histories in Azure Repos.

Thank you



Solution 1:[1]

for your database objects (views/procs etc) you really need to add the whole database to your visual studio solution.

Right click on the solution in VS

  • Add new project
  • SQL Server | SQL Server Database Project (Choose a name and location to save it)
  • OK

Then Right click on the project

  • Import
  • Import database
  • Connect to your DB
  • Start

Side note: to make the database project as close as you can to what you see in SSMS, before import,

  • go to properties of database project
  • check box Include schema name in filename
  • When you import make sure Folder Structure: is set to Object type

PowerBI files, PBIX still sucks to add to source control as they are binary (zip) and contain the data. I'm not sure if there is a "useful" way to add pbix to source control

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Trubs