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: 

Associating a Git Credential with a Service Principal using Terraform Provider (AWS)

Kinger
New Contributor

I am attempting to create a Databrick Repo in a workspace via Terraform. I would like the Repo and the associated Git Credential to be associated with a Service Principal. 

In my initial run, the Terraform provider is associated with the user defined in the .databrickscfg file and when resources were created, the user had a link to the created Git Credential. This causes issues if that particular user already had a git credential (since there can only be 1 git credential associated with a user).

To avoid the Git Credential getting associated with the user, I would like to

- Create a Service Principal

- Create a git credential associated with that Service Provider

- Have the repo creation be done using that git credential. Basically, create the repo using the created Service Principal

I have not found a way to get the git credential associated with the SP and associate the SP with the Repo creation in terraform. I have seen some threads saying you can associate an SP for repo creation but they seem to be on Azure or just via the CLI? Can this be done in the databricks terraform provider?

Thank you.

2 REPLIES 2

Hello, could you attach any reference post/article around this? I'm also trying to associate an SP with a Git Credential, so that I can set the SP as "run_as" in the Databricks Job config. I have AWS as the cloud.

nicole_lu_PM
Databricks Employee
Databricks Employee

Hi Kinger and Debi-Moha,

Do the steps in the "Use a service principal with Databricks Git folders" documentation work for you? 

Specifically for Terraform: https://docs.databricks.com/en/repos/ci-cd-techniques-with-repos.html#terraform-integration

Thank you,

Nicole

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