{"id":100799,"date":"2023-11-26T17:39:47","date_gmt":"2023-11-26T17:39:47","guid":{"rendered":"https:\/\/www.red-gate.com\/simple-talk\/?p=100799"},"modified":"2024-09-03T20:04:48","modified_gmt":"2024-09-03T20:04:48","slug":"updates-about-database-projects-for-microsoft-fabric","status":"publish","type":"post","link":"https:\/\/www.red-gate.com\/simple-talk\/blogs\/updates-about-database-projects-for-microsoft-fabric\/","title":{"rendered":"Updates about Database Projects for Microsoft Fabric"},"content":{"rendered":"<p>comp A few weeks ago, I wrote a blog about <a href=\"https:\/\/www.red-gate.com\/simple-talk\/blogs\/database-projects-for-microsoft-fabric-data-warehouse\/\">Database Projects for Microsoft Fabric<\/a>. It&#8217;s an interesting advance, but it was disappointing because it was only available in half. Updating the Fabric Data Warehouse was not possible yet.<\/p>\n<p>The <a href=\"https:\/\/blog.fabric.microsoft.com\/en-US\/blog\/microsoft-fabric-november-2023-update\/#post-5122-_Toc1076052963\">November updates for Microsoft Fabric<\/a> announces the support for<strong> SQLPackage<\/strong>, but I couldn&#8217;t find additional details. Database Projects uses <strong>SQLPackage<\/strong> to execute its operations.\u00a0If <strong>SQLPackage<\/strong> works, database projects should as well.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"808\" height=\"524\" class=\"wp-image-100800\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2023\/11\/a-white-text-on-a-white-background-description-au.png\" alt=\"A white text on a white background\n\nDescription automatically generated\" \/><\/p>\n<p>A new round of tests on the database projects for Fabric shows advances, but it&#8217;s still disappointing.<\/p>\n<h2>Database Projects 101<\/h2>\n<p>A quick remind about some basic concepts:<\/p>\n<ul>\n<li>Database Projects have the extension <em>.sqlproj<\/em><\/li>\n<li>They are .NET projects<\/li>\n<li>.NET Builds them, generating a resulting compilation<\/li>\n<li>The resulting file uses the extension <strong><em>.DACPAC<\/em><\/strong><\/li>\n<li><strong>SQLPackage<\/strong> works with the <strong>DACPAC<\/strong> for its operations<\/li>\n<\/ul>\n<h2>Database Project Operations<\/h2>\n<p>These are the main operations we can make over a database project:<\/p>\n<p><strong>Import:<\/strong> Import the schema from a source, creating a new database project<\/p>\n<p><strong>Compare:<\/strong> Compare source and target<\/p>\n<p><strong>Apply:<\/strong> Apply the comparison between source and target. This can be to bring to the project new objects from the database or update the database with the project changes.<\/p>\n<h2>What doesn&#8217;t work<\/h2>\n<p>Let&#8217;s look at a list of details which still don&#8217;t work very well, and finally see what works.<\/p>\n<h3>ALTER TABLE is not Supported<\/h3>\n<p>You can&#8217;t make changes to existing tables because <strong>ALTER TABLE<\/strong> is not supported on these tools.<\/p>\n<p>This is a huge missing feature, because makes it impossible to use this resource for source control. You can&#8217;t update the schema of a table.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"972\" height=\"159\" class=\"wp-image-100801\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2023\/11\/a-screen-shot-of-a-computer-description-automatic-1.png\" alt=\"A screen shot of a computer\n\nDescription automatically generated\" \/><\/p>\n<h2>System Views are imported<\/h2>\n<p>The database project also imports the new System Views used to register information about the Data Warehouse access. This has the potential to cause failures and mistakes.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1098\" height=\"78\" class=\"wp-image-100802\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2023\/11\/word-image-100799-3.png\" \/><\/p>\n<h2>Dynamic Data Mask is not Supported<\/h2>\n<p>If you import the schema from a Data Warehouse after applying Dynamic Data Mask, it imports the script. However, when you try to Build the project, it fails, because it doesn&#8217;t support Dynamic Data Mask.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1493\" height=\"39\" class=\"wp-image-100803\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2023\/11\/word-image-100799-4.png\" \/><\/p>\n<h2>A strange constraint together the tables<\/h2>\n<p>A UNIQUE NOT ENFORCED constraint comes together some tables. This is not something we generated, it&#8217;s auto generated by the data warehouse, and it has the potential to cause failures on the database project process.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"751\" height=\"342\" class=\"wp-image-100804\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2023\/11\/a-screenshot-of-a-computer-description-automatica-132.png\" alt=\"A screenshot of a computer\n\nDescription automatically generated\" \/><\/p>\n<p>This strange constraint creates&#8230; an ALTER TABLE! (wow! This was not supported!) An ALTER TABLE is generated in the script, and it potentially will cause a failure.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1286\" height=\"507\" class=\"wp-image-100805\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2023\/11\/a-computer-code-with-black-text-description-autom.png\" alt=\"A computer code with black text\n\nDescription automatically generated\" \/><\/p>\n<h2>What DOES work<\/h2>\n<p>Once you adjust your project to get rid of all the potential failures, it will work.<\/p>\n<p>The command prompt works to generate a script:<\/p>\n<p><em>sqlpackage \/Action:Script \/SourceFile:C:\\Repos\\FabricDW\\FabricDW\\bin\\Debug\\FabricDW.dacpac \/TargetConnectionString:&#8221;Server=4ngkmr53hynexeqmk5pzxcjane-efsof4xhinfepeucrfriwvmmka.datawarehouse.pbidedicated.windows.net; Authentication=Active Directory Interactive; Database=MaltaDW&#8221; \/OutputPath:C:\\Repos\\FabricDW\\SQLScripts\\script.sql<\/em><\/p>\n<p>You can generate a script directly on <strong>Azure Data Studio<\/strong><\/p>\n<p>On both scenarios, you need to take care to exclude all the potential failures from the script. After the schema comparison, you can choose which differences you would like to apply and which differences you wouldn&#8217;t.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"806\" height=\"365\" class=\"wp-image-100806\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2023\/11\/a-screenshot-of-a-computer-description-automatica-133.png\" alt=\"A screenshot of a computer\n\nDescription automatically generated\" \/><\/p>\n<p>You can apply the changes directly from <strong>Azure Data Studio<\/strong><\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"1208\" height=\"343\" class=\"wp-image-100807\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2023\/11\/a-screenshot-of-a-computer-description-automatica-134.png\" alt=\"A screenshot of a computer\n\nDescription automatically generated\" \/><\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1114\" height=\"58\" class=\"wp-image-100808\" src=\"https:\/\/www.red-gate.com\/simple-talk\/wp-content\/uploads\/2023\/11\/word-image-100799-9.png\" \/><\/p>\n<p>You need to have the same care to avoid potential problems as when generating the script.<\/p>\n<h2>Important Last Notes<\/h2>\n<ul>\n<li>I completed all the tests using Azure Data Studio Insiders version<\/li>\n<li>Once opened, it identified a new version of the Database Project extension. The versions I have installed after the updates are Azure Data Studio Insiders 1.47.0 and Database Project extension 1.4.1<\/li>\n<li>Sometimes you still receive a token error mistake on Azure Data Studio, when connecting to Azure. Once you open it as an Administrator the problem is solved.<\/li>\n<li>The need to fix the <strong>.sqlproj<\/strong> file on notepad (I mentioned this on the previous blog) still happened, but only once and probably because a mixed version of the Data Studio and extension.<\/li>\n<\/ul>\n<h2>Summary<\/h2>\n<p>It&#8217;s evolving and it&#8217;s evolving fast. But it&#8217;s still far from usable in a production environment. Maybe some more months.<\/p>\n<p>It&#8217;s impossible to not notice how some features are being announced as available in\/for Fabric when they still require a lot more work for production environments.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>comp A few weeks ago, I wrote a blog about Database Projects for Microsoft Fabric. It&#8217;s an interesting advance, but it was disappointing because it was only available in half. Updating the Fabric Data Warehouse was not possible yet. The November updates for Microsoft Fabric announces the support for SQLPackage, but I couldn&#8217;t find additional&#8230;&hellip;<\/p>\n","protected":false},"author":50808,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2,159164],"tags":[145424,123645,159041,158997],"coauthors":[6810],"class_list":["post-100799","post","type-post","status-publish","format-standard","hentry","category-blogs","category-microsoft-fabric","tag-azure-data-studio","tag-data-warehouse","tag-database-project","tag-microsoft-fabric"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/100799","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/users\/50808"}],"replies":[{"embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/comments?post=100799"}],"version-history":[{"count":2,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/100799\/revisions"}],"predecessor-version":[{"id":100810,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/posts\/100799\/revisions\/100810"}],"wp:attachment":[{"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/media?parent=100799"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/categories?post=100799"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/tags?post=100799"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.red-gate.com\/simple-talk\/wp-json\/wp\/v2\/coauthors?post=100799"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}