There is currently no direct configuration field inside a Databricks Asset Bundle (DAB) to override the Terraform Databricks provider version that databricks bundle deploy uses. The provider version (like 1.71.0) is automatically chosen by the Databricks CLI based on the bundle schema it was built against. However, there are workarounds that allow you to force DAB to use your local provider (like 1.50.0) even in a closed or airโgapped network.โ
Recommended Workaround
To pin the provider version offline and bypass the registry check, you can preโcreate a Terraform lock file and local mirror.
-
Create a Terraform CLI config file (terraform.rc or cli.tfrc):
provider_installation {
filesystem_mirror {
path = "/path/to/providers"
include = ["*/*/*"]
}
direct {
exclude = ["*/*/*"]
}
}
Then set the environment variable:
export TF_CLI_CONFIG_FILE=/path/to/terraform.rc
-
Manually create a terraform.hcl.lock file:
Before running databricks bundle deploy, create a file under
.databricks/bundle/stage/terraform/terraform.hcl.lock and specify your desired provider version and checksum (matching your downloaded 1.50.0 provider).
This locks the CLI to that version and disables remote version queries.โ
-
Set Databricks CLI environment variables in your DevOps pipeline:
export DATABRICKS_TF_PROVIDER_VERSION=1.50.0
export DATABRICKS_TF_EXEC_PATH=/path/to/terraform
export DATABRICKS_TF_CLI_CONFIG_FILE=/path/to/terraform.rc
While DATABRICKS_TF_PROVIDER_VERSION does not always override the internal version constraint, setting it along with the local lock and mirror ensures Terraform uses your supplied local provider.โ
-
Avoid reโgeneration of bundle.tf.json between runs:
The CLI autoโproduces this each deploy, so rely on overriding behavior with lock files and mirrors rather than editing it directly.
Why editing bundle.tf.json does not work
bundle.tf.json is autoโgenerated and overwritten by the Databricks CLI each deployment. Even if you manually set the version inside it, the CLI will regenerate it based on the internal template schema that hardcodes the supported provider (1.71.0 currently).โ
Summary
| Goal |
Action |
| Force older provider version |
Preโcreate .databricks/bundle/stage/terraform/terraform.hcl.lock referencing your desired version โ |
| Avoid internet download |
Configure TF_CLI_CONFIG_FILE to a local provider_installation mirror โ |
Databricks CLI ignores DATABRICKS_TF_PROVIDER_VERSION |
Use with lock file and mirror together; standalone variable is not enough โ |
By combining a manually created local mirror and lockfile, you can reliably use a pinned Databricks provider (like 1.50.0) inside a restricted network where automatic provider fetching fails.