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

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
SergioTorrinha
Resolver II
Resolver II

Error Syncing Notebooks from Microsoft Fabric UI to VS Code

Hello everyone,


I'm encountering an issue when attempting to sync notebooks from the Microsoft Fabric UI to Visual Studio Code.
Whenever I try to sync a notebook, I receive a 401 error in VS Code. Here are the details and steps I've already taken to troubleshoot the problem:

Issue:

  • I have two distinct Microsoft Fabric accounts, from two distinct and completly unrelated tennats. In one account, I can log in and operate perfectly in VS Code. However, the second account is where I encounter the problem.

  • In my second accountt, when I attempt to sync a notebook from the Microsoft Fabric UI to VS Code, I immediately receive a 401 error in VS code.
  • Additionally, my work colleague is experiencing a similar issue with VS Code, indicating it might be a broader problem.

Here are the steps I have taken to resolve:

  1. Re-authenticated in Microsoft Fabric UI and VS Code.

  2. Verified permissions and ensured I have the necessary access to the notebooks and the Synapse workspace.

  3. Cleared browser cache and cookies.

  4. Updated all related VS Code extensions (Synapse, Python, etc.) to the latest versions.

  5. Verified environment variables and paths for Python and Anaconda installations.

  6. Checked network and firewall settings to ensure there are no blocks or restrictions.

 

Additional Information:

  • I have confirmed that the network settings are not blocking connections.

  • All other steps to clear browser cache and re-authenticate have been tried, but did not resolve the issue. Inclusively, I have tried to uninstall and re-install Synapse extention

  • Perhaps unrelated, but interesting detail nonetheless: I can authenticate with SSMS in my second account ms fabric workspace, and operate perfectly with all SQL Analytics Endpoints in there.


I would greatly appreciate any insights or suggestions to resolve this authentication issue.
Thank you in advance for your help.

10 REPLIES 10
SergioTorrinha
Resolver II
Resolver II

Hi @Anonymous !

Thanks for taking the time to pick this one up.
I will try to answer your questions, one by one, below:

1 - So you mean these two account both test on the same device? Did these accounts host on the same region with corresponding permissions?
I don't know if I fully understand what you mean with '(...) these two account both test on the same device (...)'.
What happens here is that these two (distinct) account are from two (distinct and completely unrelated) tenants -they are  independent from one another, since they belong to unrelated tenants.
Furthermore let's not forget, and I think this is important, that my work colleague, who has only a single MS Fabric account also had the same 401 error after syncing a notebook, from the same ms fabric workspace, with her local machine/vs code.

I hope this part is very clear and, please let me know, if I misunderstood you.


2 - Have you tried to use different work folders to handle these accounts to prevent the credentials and sessions, local cache conflict issues?
Also not sure if I have done this or if it would be needed, since in the documentation I haven't found anything that explicitly would point me into that direction.
Actually, in the documentation, it simply states that '(...) The local working directory of the extension serves as the local root folder for all downloaded notebooks, even notebooks from different workspaces. (...)'
In any case, I have delved a bit into the setting JSON and changed the working folder in there but don't know if this is the correct way to do it and/or if this is what you meant.

And by the way, allow me an extra question:
Where is it stated that one needs to adjust the working folder when syncing notebooks from distinct workspaces and/or tenants ?
Because that message does not popup when one press the sync vs code button in MS Fabric.

Please, let me know what other details are important here. I'm glad to provide them as long as you don't require private information of course. 😁😀
Thank you.

Anonymous
Not applicable

HI @SergioTorrinha,

In fact, the above thoughts are based on the error code instead of official document.

AFAIK, the HTTP 401 Unauthorized client error status response code indicates that the request has not been applied because it lacks valid authentication credentials for the target resource.

Since this error is related to the credentials and you also mentioned is switch between two accounts. So I will ask you to confirm the credential reasons during these operations at first (e.g. oauth token, session and local file cache) and tried to host them to different work folders to prevent the confit issue.

When you directly switch account on the device with cache file and active sessions, they may confit the sign in operations to the new account. (it used the cache data to quickly sign-in instead of use new credentials that you provide at the second time and obviously they will cause the authorization credential issues)

Regards,

Xiaoxin Sheng

Hi @Anonymous !

I don't know if you had the oportunity to read my notes below, but I just would like to add something I have found in the meanwhile and that I think it might be related to this syncing issue:
it turns out that I am also not able to log in to PBI desktop with the same account that I have issues in vscode - more specifically, when I try to log in PBI desktop I am redirected to a brower webpage where its says 'Your organisation doesn't currently allow its users to purchase Microsoft Fabric free. Contact your IT admin for more information.'.
What does this mean exactly? Below is a print of the messaage I get:
ms_fabric_pbi.png


So, I wonder, if it's possible, that some admin setting is turned or or off that might trigger this behaviour? To note that I am not the adim of the tenant so I cannot test things in that regard, hence I would apretiate your thoughts on it.

Looking forward to your input.
Thank you.

Anonymous
Not applicable

Hi @SergioTorrinha,

I'd like to suggest you take a look at the following document about block self-service usage if it suitable to your scenarios:

About self-service sign-ups and purchases - Power BI | Microsoft Learn

BTW, you can also check if they enabled the device protect about azure account usages:

Safeguarding and stopping the user personal device from Azure AD register to my Azure tenant? - Micr...

Regards,

Xiaoxin Sheng

Hi @Anonymous,
Thanks for the input!
I will definitly check this interanally.

Anonymous
Not applicable

Hi @SergioTorrinha ,

Any update on this? Did the above suggestions help with your scenario? 

Regards,

Xiaoxin Sheng

Hi @Anonymous !

After checking internally, it turns out that my MS Fabric admin is not allowing us (blocking us) to use PBI, hence, I beleive, the dificculty on connecting PBI desktop to my semantic model residing in MS Fabric. However, it is unclear for me at this point, if this 'block' scenario is also affecting VS code.

 

With the above in mind, I would like your help to understand a bit better the issue I'm currently facing. For starters, can you be so kind and specifically answer on each of my two questions bellow, please?

1. Regarding VS Code authentication, is there any admin portal setting that blocks autenticating to MS Fabric via VS Code? In affirmative case, which setting is it? I would like to specifically indicate this setting, so my admin don't waste time looking for it and we can move forwards with our developments without any constraint. Furthermore, I have been reading the documentation about VS code integration and I found no evidence that VS code can be blocked, so this question is simply to ensure I'm not wrong on this.

2. I understand that the usage of PBI service is blocked by my MS Fabric admin. However, is it possible to connect via PBI desktop to my semantic model without using the PBI service for now? Is there any admin setting that should be unlocked to be able to do this?
My project is in a PoC stage and I would like to use PBI in future analysis related work, so making a PoC in PBI desktop would be a way to add value on that regard.

Looking forward for your clarifications.
Thank you.

Hi @Anonymous !

Not yet. I will get back to you on this whenever I have soemthign to share.

Thank you.

Hi @Anonymous !

Sorry for late response, I've been out a couple of days to enjoy some Chrismas time with family. 🙂

 

Anyway,  thanks for the input, from which I have tried your suggestion to clear local cache ( because I really don't know how to perform that in VS Code, I followed suggestions here, so please let me know if there is a better way to do it ) and I also switched the working folder ctlr + shift + P > Synapse: Set Local Work Folder.

 

After these operations, unfortunantly, I still have the 401 error.

What I find weird is that, eventhough, I am logged in with the correct user and no workspace is selected, as soon as I click the select workspace button the error is triggered...

 

Any thgouhts on what to do next?

Thank you.


Anonymous
Not applicable

HI @SergioTorrinha,

So you mean these two account both test on the same device? Did these accounts host on the same region with corresponding permissions?

Have you tried to use different work folders to handle these accounts to prevent the credentials and sessions, local cache conflict issues?

Please share some more detail information about this issue and they should help us clarify your scenario and test to troubleshoot.

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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