Skip to content

bundle deploy fails with azure-devops-oidc auth - missing env var SYSTEM_TEAMFOUNDATIONCOLLECTIONURI #4161

@ylashin

Description

@ylashin

Describe the issue

When using azure-devops-oidc authentication in Azure DevOps pipelines, CLI commands like databricks current-user me and databricks bundle validate work correctly. However, databricks bundle deploy fails during the Terraform apply phase. The error message is as follows:

Error: terraform apply: exit status 1

Error: cannot create job: failed during request visitor: azure-devops-oidc auth: not calling from Azure DevOps Pipeline: missing env var SYSTEM_TEAMFOUNDATIONCOLLECTIONURI. Config: host=https://adb-xxxx.azuredatabricks.net, client_id=<CLIENT_ID>. Env: DATABRICKS_HOST, DATABRICKS_CLIENT_ID

  with databricks_job.gnaf_dlt_orchestrator_job,
  on bundle.tf.json line 54, in resource.databricks_job.gnaf_dlt_orchestrator_job:
  54:       },

I was actually facing issue #4047 yesterday and once it has been fixed, the current issue started to appear.

Steps to reproduce the behavior

  1. Configure a Databricks service principal with Azure DevOps OIDC federation policy
  2. Set up an Azure DevOps pipeline like the following :
steps:
    - task: Bash@3
      inputs:
        targetType: 'inline'
        script: |
          databricks bundle deploy -t dev
      displayName: 'Deploy Bundle'
      env:
        DATABRICKS_HOST: $(DATABRICKS_HOST)
        DATABRICKS_CLIENT_ID: $(DATABRICKS_CLIENT_ID)
        DATABRICKS_AUTH_TYPE: azure-devops-oidc
        SYSTEM_ACCESSTOKEN: $(System.AccessToken)
  1. Run the pipeline

Expected Behavior

databricks bundle deploy should deploy the bundle successfully.

Actual Behavior

Bundle deployment fails and the DevOps task fails with error ##[error]Bash exited with code '1'

OS and CLI version

  • Databricks CLI v0.281.0
  • Ubuntu (Azure DevOps hosted agent vmImage: ubuntu-latest)

Is this a regression?

  • Unknown

Debug Logs

Error: terraform apply: exit status 1

Error: cannot create job: failed during request visitor: azure-devops-oidc auth: not calling from Azure DevOps Pipeline: missing env var SYSTEM_TEAMFOUNDATIONCOLLECTIONURI. Config: host=https://adb-xxxx.azuredatabricks.net, client_id=<CLIENT_ID>. Env: DATABRICKS_HOST, DATABRICKS_CLIENT_ID

  with databricks_job.gnaf_dlt_orchestrator_job,
  on bundle.tf.json line 54, in resource.databricks_job.gnaf_dlt_orchestrator_job:
  54:       },

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingDABsDABs related issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions