I'm deploying my Databricks Workspace resources using Terraform. I want to create a catalog that points to SQL Server using Lakehouse Federation feature. I'd like to reference the user and password as pointers to secret scope backed by Azure Key Vault. It's possible using SQL scripts, but found no docs on how to do it with Terraform. Have you guys have any idea how the code should look like?
What I want to replicate
CREATE CONNECTION sqlserver_connection TYPE sqlserver
host '<hostname>',
port '<port>',
user secret ('<secret-scope>','<secret-key-user>'),
password secret ('<secret-scope>','<secret-key-password>')
)
in Terraform
resource "databricks_connection" "sqlserver" {
name = "sqlserver_connection"
connection_type = "SQLSERVER"
options = {
host = "test.database.windows.net"
port = "1433"
user = "user" // a reference to secret scope
password = "password" // as above
}
}
I'm aware it's still in Public Preview though.
Have tried all the docs I've been able to find, REST API documentation, even tried to check to Github repo for Databricks provider. Sadly to no avail.
To connect to
SQL ServerfromAzure Databrickswithout hardcoding the SQL username and password, you can create secrets inAzure Key Vaultto store the username and password. Then, you can use a data block to retrieve the SQL username and password.Here is the update to connect to a
SQL databasefrom azure databricks.Terraform apply:
After running the code, SQL connection has been established successfully from data bricks workspace.
Refer: Stack link answered by
me