Service Principal Access to Users Directory in Databricks - Creating Git Folders
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 10:51 AM
I am trying to automate the creation of git folders in user workspace directories triggered by GitHub feature branch creation. When developers create feature branches in GitHub, we want a service principal to automatically create corresponding git folders in their Databricks workspace (/Workspace/Users/username/).
Current Setup:
- Service Principal with workspace admin permissions
- GitHub Actions workflow using Databricks CLI
- Command attempting folder creation: databricks workspace mkdirs "/Workspace/Users/username"
Error: Error: Folder Users is protected
Note: Creating Repos (not git folders) works using the Service Principal, but users can't modify them - highlighting a gap in both approaches.
Questions:
- Can service principals create git folders under /Workspace/Users/?
- Is there a recommended approach for this automation?
- Are features planned to support this workflow?
Goal: Automated git folder creation in developer workspaces with proper user permissions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 10:58 AM
Can service principals create git folders under /Workspace/Users/?
- No, service principals cannot create folders under /Workspace/Users/ as this directory is protected. This is why you are encountering the "Error: Folder Users is protected" message.
Is there a recommended approach for this automation?
- One option is to create a top-level directory for each user under a different path that is not protected, such as /Workspace/Projects/username/. This way, you can manage permissions and automate the creation of these directories without running into the protected folder issue.
-
Are features planned to support this workflow?
There is no planned features to support the creation of git folders under /Workspace/Users/ by service principals, I will create one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 11:13 AM
Thank you Alberto. for your reference you can include the following in the feature request.
Request: Enable service principals to create git folders in user workspaces for secure GitHub synchronization, supporting:
- Developer creates feature branch
- Service principal manages synchronisation
- Automated git folder creation in user workspace
- Proper permission inheritance
This maintains security through centralized authentication while enabling automated workflows that meet enterprise security requirements.
if you need more information I can provide.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2025 01:50 AM
Alberto can you give me a link to the feature request if it's on any of your Github repos? I'd like to provide more information. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2025 04:35 AM
Hi @Brianhourigan,
Can you please DIM your suggestions? I can add it to our internal AHA idea.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2025 04:36 AM
Hi Alberto sure.
I'll draw out the flow and my thoughts. and send it on
Thanks

