killumi_91
killumi_91

Reputation: 21

Databricks Asset Bundle Parse Environment Variable From Azure DevOps Pipeline

I am trying to pass a variable from an ADO Pipeline to a databricks.yml file needed for asset bundle as for the documentation https://learn.microsoft.com/en-us/azure/databricks/dev-tools/bundles/settings#bundle-syntax-custom-variables:~:text=Provide%20the%20variable%E2%80%99s%20value%20by,deploy%2C%20or%20run%3A.

This is my azure devops yaml:

- bash: |
    BUNDLE_VAR_DATABRICKS_HOST="${DATABRICKS_HOST}" databricks bundle validate
    databricks bundle deploy
    displayName: 'DAB'
    env:
    DATABRICKS_TOKEN: $(DATABRICKS_TOKEN)
    BUNDLE_VAR_MY_VARIABLE: $(DATABRICKS_HOST)
    workingDirectory: $(ArtifactRoot)

My databricks.yml looks like:

bundle:
  name: test

include:
  - resources/*.yml

targets:
  dev:
    mode: development
    default: true
    workspace:
      host: ${DATABRICKS_HOST}

Unfortunately is not rendering correctly when I also try running it manually :

BUNDLE_VAR_DATABRICKS_HOST=<databricks host> bundle validate

Upvotes: 1

Views: 540

Answers (1)

V.Cunha
V.Cunha

Reputation: 157

You cannot put host in a custom variable according to the documentation.

https://docs.databricks.com/en/dev-tools/bundles/settings.html#other-workspace-mappings

Upvotes: -1

Related Questions