Associating a Git Credential with a Service Principal using Terraform Provider (AWS)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 06:48 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2024 02:11 AM - edited 04-05-2024 02:11 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-27-2024 11:20 AM
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

