Forum Discussion
Heads-up! Misleading error message GitProviderResourceNotFound
In this example, I'm using an Azure DevOps - Source Control connection configured with Service Principal authentication as shown on the image below
Using this connection, I'm invoking a interface Git - Connect - REST API (Core) | Microsoft Learn , following the example provided in Connect a workspace to Azure DevOps using configured connection example and implemented using PowerShell script, in the image below you can see how the call is correct, but I'm getting an error "{"requestId":"xxxxxxxx-xxxx-xxxx-xxxxxxxxxx","errorCode":"GitProviderResourceNotFound","message":"The requested operation can't be completed because the Git provider resource could not be found using the provided Git connection details."}"
After a LONG INVESTIGATION following what the error suggested the problem was (e.g. ID of the connection incorrect, lack of permissions, etc) and ruling-out many alternatives, I concluded that it wasn't none of this but the issue was that, on the target branch reference in the example shown "workspace/ws_test-auto-deploy_dev" did not contain "directoryName": "/fabric"
This post if basically to let you guys know this if you are using this interface via a Azure DevOps Connection and check your target branches as this error won't tell you the reall issue! I create a new idea Fix misleading error message GitProviderResourceNo... - Microsoft Fabric Community for you guys to vote to request better error messages 😉🤞
After a LONG INVESTIGATION following what the error suggested the problem was (e.g. ID of the connection incorrect, lack of permissions, etc) and ruling-out many alternatives, I concluded that it wasn't none of this but the issue was that, on the target branch reference in the example shown "workspace/ws_test-auto-deploy_dev" did not contain "directoryName": "/fabric"
4 Replies
- tayloramy
Super User
- svenchio
Super User
After a LONG INVESTIGATION following what the error suggested the problem was (e.g. ID of the connection incorrect, lack of permissions, etc) and ruling-out many alternatives, I concluded that it wasn't none of this but the issue was that, on the target branch reference in the example shown "workspace/ws_test-auto-deploy_dev" did not contain "directoryName": "/fabric"
- frithjof_v
Community Champion
I had the same issue when trying to connect a workspace to GitHub using the API.
It turns out I had to create the workspace folder in GitHub first (in my case: workspace/engineering, workspace/store, workspace/presentation) before attempting to connect the workspace to GitHub.
When we connect a workspace to GitHub in the workspace settings user interface, the GitHub directory gets created if it doesn't already exist.
But, when using the API to connect a workspace to GitHub, we need to create the folder in GitHub first before we can make the connection.
- v-kpoloju-msft
Community Support
Hi frithjof_v,
Thank you for the follow-up question.
This issue usually occurs when connecting a workspace to GitHub via API because, unlike the UI, the API does not create the target directory automatically. Please check the API error (e.g., 404 = folder missing, 403 = permission issue), ensure the required folder (such as workspace/<folder-name>) already exists in the repository, verify the branch name is correct, and confirm you have proper repo access (PAT with required permissions). After validating these, retry the API call and it should work as expected.