You can manage Databricks Git folders in a fully automated environment using Terraform and the databricks_repo Terraform resource. In your Terraform configuration (.tf
) file, set databricks_repo
to the URL of the Git repository you will use for your Git folder(s):
resource "databricks_repo" "this" {
url = "https://github.com/user/demo.git"
}
To use a Databricks service principal with specific Git credentials, add the following configuration of providers and resources:
databricks
to the URL of your Databricks workspace. You will define the access token databricks_obo_token
in another step. provider "databricks" {
# Configuration options
}
# Example 'databricks' provider configuration
provider "databricks" {
alias = "sp"
host = "https://....cloud.databricks.com"
token = databricks_obo_token.this.token_value
}
resource "databricks_service_principal" "sp" {
display_name = "<service_principal_name_here>"
}
resource "databricks_obo_token" "this" {
application_id = databricks_service_principal.sp.application_id
comment = "PAT on behalf of ${databricks_service_principal.sp.display_name}"
lifetime_seconds = 3600
}
resource "databricks_git_credential" "sp" {
provider = databricks.sp
depends_on = [databricks_obo_token.this]
git_username = "<the_git_user_account_used_by_the_servcie_principal>"
git_provider = "<your_git_provider_string here>"
personal_access_token = "<auth_token_string_for_git_user>"
}
Read moreâ
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4