Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
sgeheeb
Helper III
Helper III

Error in Fabric SQL DB with GIT Integration

Hi,

 

I am having the following issue:

In my SQL DB in Fabric I need to reference various views from the "sys" schema (e.g. "sys.schemas").

 

I can query sys.schemas fine through the sql endpoint in Fabric and also create my own views based on sys.* elements.

I need my data base project to be in source control, so I use the git integration feature to connect to an ADO repositoy.

I can clone and open the project locally with VS Code and things look fine at first.

 

My troubles start when I try to build the project locally before deploying it, since I get build error SQL71501 (Unresolved reference to sys.schemas). So I added a reference to the master db (system database -> artifact reference -> master -> no) and got an error, because VS Code was looking for a master.dacpac at "

.vscode\extensions\ms-mssql.sql-database-projects-vscode-1.4.6\BuildDirectory\SystemDacpacs\DbFabric\master.dacpac".
 
The folder did not exist, which seemd strange to me, because it existed for other target versions (e.g. "160", "Serverless", etc.)
So I created the folder and, for a lack of ther options, put the master.dacpac from "Serverless" in there.
Now my build went through and the dependencies were resolved correctly.
 
I synced my VS Code project with ADO and the fabric workspace detects a change. When I try to update, i get the following error:
"Cannot save package to file. The model has build blocking errors: Error SQL71501: Error validating element [dbo].[SYSViewOnline]: View: [dbo].[SYSViewOnline] has an unresolved reference to object [sys].[schemas]."
 
Any ideas why this is happening? Has anyone had a similar issue?
Thanks.

 

10 REPLIES 10
jochenj
Advocate II
Advocate II

THANKS for the prompt reply, understand, one miracle solved 😉  I'm absolutely willing to switch from VS to VS Code as soon as VS Code has "schema compare" availble which is a essential tool in our developers workflow. Looking forward to see schema compare in VS Code soon, learned in another thread thats its on the roadmap for the april release roadmap · microsoft/vscode-mssql Wiki · GitHub

drew-sk
Microsoft Employee
Microsoft Employee

Hi folks - product team for SQL database in Fabric and CI/CD - acknowledging referencing system objects is an issue in the git integration and that there's isn't a workaround for it.

The resolution is underway and would involve both the master dacpac for SQL database in Fabric being published to nuget and automatically added as a package reference in the SQL project by the git integration.

We're working to get this added asap as I know leveraging those system views can be very valuable in your database.

 

@drew-sk I have following scenario:
- Initially created a Fabric DB in workspace, succefully synced to GIT 
- Now i want to open the existing DB Project from GIT in VS.Code or Visual Studio to make refactoring....and then deploy changes back to workspace/sql analytics endpoint. But when i open the file in VS i get only an empty project.

Is this a supported scenario? Can i open a fabric-generated DB Project in  VS/.Code? 

Observation: the .sqlproj file, as created by fabric, in GIT has not the known content-format and therefore i cannot open it in VS.Code/VS. With content-format i mean that the .sqlproj files i know have <PropertyItem> sections where all DB ojects like tables/views... are referenced which are part of the project. But this section is completely missing. didn't found anything in docu so i asking here:
.sqlproj file created by fabric:

jochenj_0-1744649998616.png

.sqlproj file create in VS2022:

jochenj_1-1744650259352.png

 

drew-sk
Microsoft Employee
Microsoft Employee

Great question! Fabric's source control integration leverages the SQL project SDK (Microsoft.Build.Sql) - I'd recommend editing in either the SQL Database Projects extension in VS Code. A benefit of the SDK-style SQL project is that it doesn't need all those lines in the SQLproj to reference .sql files in the folders.

 

If you're really interested in using Visual Studio, then you'll need to add a separate install of Visual Studio with the SDK-style SSDT (preview) - https://aka.ms/ssdt-sdk-preview

jochenj
Advocate II
Advocate II

i have a similar issue , but with the Fabric DevOps Pipeline instead visual studio. 
- Create a DB in Fabric Workspaces
- Added a View "admin.vTableOverview" which references [INFORMATION_SCHEMA].[TABLES].

- When trying to deploy the DB with Fabric Pipeline from DEV to PROD Workspace i get error:
Backend ErrorImport failure: DacServices. Cannot save package to file. The model has build blocking errors: Error SQL71501: Error validating element [admin].[vDBObjectOverview]: View: [admin].[vDBObjectOverview] has an unresolved reference to object [INFORMATION_SCHEMA].[TABLES].[TABLE_TYPE]. Error SQL71501: Error validating element [admin].[vDBObjectOverview]: View: [admin].[vDBObjectOverview] has an unresolved reference to object [INFORMATION_SCHEMA].[ROUTINES]. ...


Is this also a (currently) not supported scenario? 

This seems to be the same thing I am running into. I am guessing Fabric is attempting an internal build of the DB project and missing the reference to [master]. It seems like Microsoft has still not published the master db for Fabric. 

sgeheeb
Helper III
Helper III

Anyone who comes across this having similar issues: I asked at Microsoft and they told me that my basic approach is correct. However, they do not have a master db for Fabric published yet, this is why the process fails. I'll post an update when I have new information on this

v-xiaoyan-msft
Community Support
Community Support

Hi  @sgeheeb ,

 

Please make sure you have the correct references to the master database. This is crucial because system objects like sys.schemas are defined in the master database. You mentioned adding a reference to the master database, but it seems there was an issue with the master.dacpac file.

Ensure that the master.dacpac file is correctly placed in the expected directory.

Then verify that the master.dacpac file you are using is compatible with your target SQL version. Using a master.dacpac from a different version (like "Serverless") might cause issues. You might need to download the correct master.dacpac file for your target SQL version.

After placing the correct master.dacpac file, update your project references in VS Code to point to this file. This should help resolve the unresolved references.Once the references are correctly set up, try building the project again. If the build succeeds, deploy the project and check if the issue persists.

 

Hope it helps!

Best regards.
Community Support Team_Caitlyn

This isn't how the CI/CD integration in Fabric works - it may be a workaround in custom deployment pipelines through Azure DevOps or GitHub actions - but even then the recommendation would be to use a package reference (to a nuget feed) instead of an artifact reference (to a dacpac file).

Thanks for you reply, can you point me to where I can find the correct dacpac for Fabric SQL DB? https://www.nuget.org/packages/Microsoft.SqlServer.Dacpacs.Master does not contain a fabric specific version but only gives me the options which the sqlprojects extensions for VS code brought along already.

 

The problem seems to be ocurring when the Fabric Workspaces syncs the changes from the ADO repo: I can do a build on my local version and also create the views using the SQL Endpoint in Fabric. Things go wrong when Fabric syncs with ADO (which contains a version of the database which built successfully locally).

 

Have you already done this successfully? Thanks!

Helpful resources

Announcements
MarchFBCvideo - carousel

Fabric Monthly Update - March 2025

Check out the March 2025 Fabric update to learn about new features.

Notebook Gallery Carousel1

NEW! Community Notebooks Gallery

Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.

April2025 Carousel

Fabric Community Update - April 2025

Find out what's new and trending in the Fabric community.

"); $(".slidesjs-pagination" ).prependTo(".pagination_sec"); $(".slidesjs-pagination" ).append("
"); $(".slidesjs-play.slidesjs-navigation").appendTo(".playpause_sec"); $(".slidesjs-stop.slidesjs-navigation").appendTo(".playpause_sec"); $(".slidesjs-pagination" ).append(""); $(".slidesjs-pagination" ).append(""); } catch(e){ } /* End: This code is added by iTalent as part of iTrack COMPL-455 */ $(".slidesjs-previous.slidesjs-navigation").attr('tabindex', '0'); $(".slidesjs-next.slidesjs-navigation").attr('tabindex', '0'); /* start: This code is added by iTalent as part of iTrack 1859082 */ $('.slidesjs-play.slidesjs-navigation').attr('id','playtitle'); $('.slidesjs-stop.slidesjs-navigation').attr('id','stoptitle'); $('.slidesjs-play.slidesjs-navigation').attr('role','tab'); $('.slidesjs-stop.slidesjs-navigation').attr('role','tab'); $('.slidesjs-play.slidesjs-navigation').attr('aria-describedby','tip1'); $('.slidesjs-stop.slidesjs-navigation').attr('aria-describedby','tip2'); /* End: This code is added by iTalent as part of iTrack 1859082 */ }); $(document).ready(function() { if($("#slides .item").length < 2 ) { /* Fixing Single Slide click issue (commented following code)*/ // $(".item").css("left","0px"); $(".item.slidesjs-slide").attr('style', 'left:0px !important'); $(".slidesjs-stop.slidesjs-navigation").trigger('click'); $(".slidesjs-previous").css("display", "none"); $(".slidesjs-next").css("display", "none"); } var items_length = $(".item.slidesjs-slide").length; $(".slidesjs-pagination-item > button").attr("aria-setsize",items_length); $(".slidesjs-next, .slidesjs-pagination-item button").attr("tabindex","-1"); $(".slidesjs-pagination-item button").attr("role", "tab"); $(".slidesjs-previous").attr("tabindex","-1"); $(".slidesjs-next").attr("aria-hidden","true"); $(".slidesjs-previous").attr("aria-hidden","true"); $(".slidesjs-next").attr("aria-label","Next"); $(".slidesjs-previous").attr("aria-label","Previous"); //$(".slidesjs-stop.slidesjs-navigation").attr("role","button"); //$(".slidesjs-play.slidesjs-navigation").attr("role","button"); $(".slidesjs-pagination").attr("role","tablist").attr("aria-busy","true"); $("li.slidesjs-pagination-item").attr("role","list"); $(".item.slidesjs-slide").attr("tabindex","-1"); $(".item.slidesjs-slide").attr("aria-label","item"); /*$(".slidesjs-stop.slidesjs-navigation").on('click', function() { var itemNumber = parseInt($('.slidesjs-pagination-item > a.active').attr('data-slidesjs-item')); $($('.item.slidesjs-slide')[itemNumber]).find('.c-call-to-action').attr('tabindex', '0'); });*/ $(".slidesjs-stop.slidesjs-navigation, .slidesjs-pagination-item > button").on('click keydown', function() { $.each($('.item.slidesjs-slide'),function(i,el){ $(el).find('.c-call-to-action').attr('tabindex', '-1'); }); var itemNumber = parseInt($('.slidesjs-pagination-item > button.active').attr('data-slidesjs-item')); $($('.item.slidesjs-slide')[itemNumber]).find('.c-call-to-action').attr('tabindex', '0'); }); $(".slidesjs-play.slidesjs-navigation").on('click', function() { $.each($('.item.slidesjs-slide'),function(i,el){ $(el).find('.c-call-to-action').attr('tabindex', '-1'); }); }); $(".slidesjs-pagination-item button").keyup(function(e){ var keyCode = e.keyCode || e.which; if (keyCode == 9) { e.preventDefault(); $(".slidesjs-stop.slidesjs-navigation").trigger('click').blur(); $("button.active").focus(); } }); $(".slidesjs-play").on("click",function (event) { if (event.handleObj.type === "click") { $(".slidesjs-stop").focus(); } else if(event.handleObj.type === "keydown"){ if (event.which === 13 && $(event.target).hasClass("slidesjs-play")) { $(".slidesjs-stop").focus(); } } }); $(".slidesjs-stop").on("click",function (event) { if (event.handleObj.type === "click") { $(".slidesjs-play").focus(); } else if(event.handleObj.type === "keydown"){ if (event.which === 13 && $(event.target).hasClass("slidesjs-stop")) { $(".slidesjs-play").focus(); } } }); $(".slidesjs-pagination-item").keydown(function(e){ switch (e.which){ case 37: //left arrow key $(".slidesjs-previous.slidesjs-navigation").trigger('click'); e.preventDefault(); break; case 39: //right arrow key $(".slidesjs-next.slidesjs-navigation").trigger('click'); e.preventDefault(); break; default: return; } $(".slidesjs-pagination-item button.active").focus(); }); }); // Start This code is added by iTalent as part of iTrack 1859082 $(document).ready(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); $("#tip2").attr("aria-hidden","true").addClass("hidden"); $(".slidesjs-stop.slidesjs-navigation, .slidesjs-play.slidesjs-navigation").attr('title', ''); $("a#playtitle").focus(function(){ $("#tip1").attr("aria-hidden","false").removeClass("hidden"); }); $("a#playtitle").mouseover(function(){ $("#tip1").attr("aria-hidden","false").removeClass("hidden"); }); $("a#playtitle").blur(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); }); $("a#playtitle").mouseleave(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); }); $("a#play").keydown(function(ev){ if (ev.which ==27) { $("#tip1").attr("aria-hidden","true").addClass("hidden"); ev.preventDefault(); return false; } }); $("a#stoptitle").focus(function(){ $("#tip2").attr("aria-hidden","false").removeClass("hidden"); }); $("a#stoptitle").mouseover(function(){ $("#tip2").attr("aria-hidden","false").removeClass("hidden"); }); $("a#stoptitle").blur(function(){ $("#tip2").attr("aria-hidden","true").addClass("hidden"); }); $("a#stoptitle").mouseleave(function(){ $("#tip2").attr("aria-hidden","true").addClass("hidden"); }); $("a#stoptitle").keydown(function(ev){ if (ev.which ==27) { $("#tip2").attr("aria-hidden","true").addClass("hidden"); ev.preventDefault(); return false; } }); }); // End This code is added by iTalent as part of iTrack 1859082
Top Kudoed Authors