- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2025 10:52 AM
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.rcorcli.tfrc):textprovider_installation { filesystem_mirror { path = "/path/to/providers" include = ["*/*/*"] } direct { exclude = ["*/*/*"] } }Then set the environment variable:
bashexport TF_CLI_CONFIG_FILE=/path/to/terraform.rc -
Manually create a
terraform.hcl.lockfile:
Before runningdatabricks bundle deploy, create a file under.databricks/bundle/stage/terraform/terraform.hcl.lockand specify your desired provider version and checksum (matching your downloaded1.50.0provider).
This locks the CLI to that version and disables remote version queries. -
Set Databricks CLI environment variables in your DevOps pipeline:
bashexport DATABRICKS_TF_PROVIDER_VERSION=1.50.0 export DATABRICKS_TF_EXEC_PATH=/path/to/terraform export DATABRICKS_TF_CLI_CONFIG_FILE=/path/to/terraform.rcWhile
DATABRICKS_TF_PROVIDER_VERSIONdoes 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.jsonbetween 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.