I want to configure the Databricks Terraform provider to authenticate with the Databricks account API using the account_id
of a service principal with account_admin
permissions.
Is there a way to do so as I can't obtain the account_id
from a service principal. When specifying the application ID of the service principal as the account_id
, I will get following error messages:
Error: cannot read metastore: Failed to retrieve tenant ID for given token
Configuring the provider with an account_id
from a "real" user with account_admin
permissions is working though.
Here is my Terraform Databricks provider (account-level) configuration:
provider "databricks" {
alias = "account-level"
host = "https://accounts.azuredatabricks.net"
account_id = "00000000-0000-0000-0000-000000000000"
}
To use service principal, you need to provide client ID, client secret, and Azure tenant ID (see docs). Here is the working example from my code: