Forum Discussion
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:
Re-authenticated in Microsoft Fabric UI and VS Code.
Verified permissions and ensured I have the necessary access to the notebooks and the Synapse workspace.
Cleared browser cache and cookies.
Updated all related VS Code extensions (Synapse, Python, etc.) to the latest versions.
Verified environment variables and paths for Python and Anaconda installations.
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
- AnonymousNot 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
- SergioTorrinha
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.- AnonymousNot 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
- SergioTorrinha
Resolver II
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.