cancel
Showing results for 
Search instead for 
Did you mean: 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results for 
Search instead for 
Did you mean: 

Service Principal Access to Users Directory in Databricks - Creating Git Folders

Brianhourigan
Visitor

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:

  1. Can service principals create git folders under /Workspace/Users/?
  2. Is there a recommended approach for this automation?
  3. Are features planned to support this workflow?

Goal: Automated git folder creation in developer workspaces with proper user permissions

2 REPLIES 2

Alberto_Umana
Databricks Employee
Databricks Employee

Hi @Brianhourigan 

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.

Brianhourigan
Visitor

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:

  1. Developer creates feature branch
  2. Service principal manages synchronisation
  3. Automated git folder creation in user workspace
  4. 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. 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group