cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot deploy DAB with the Job branch using a feature branch in Workspace UI

SangNguyen
New Contributor II

Hi, 

I tried to deploy DAB on Workspace UI with a feature branch (sf-trans-seq) targeted to Dev. After deploying successfully, the Job branch is, however, using the master branch (see the screenshot below).
Issue - DAB Deployment on Workspace UI.png

Is there any option to force the Job branch to use the feature branch (e.g., sf-trans-seq) similar to the git-branch option when deploy using Databricks CLI in VS Code? 

databricks bundle deploy -var="git-branch=sf-trans-seq" -t dev

SangNguyen_0-1756138153447.png

Thanks, 

 

1 ACCEPTED SOLUTION

Accepted Solutions

SangNguyen
New Contributor II

I found how to add the "git-branch" to override in Workspace UI. 

From Deploy --> Configure variable overrides --> enter the {"git-branch":"sf-trans-seq"} to the variable-overrides.json file.

SangNguyen_0-1756696199388.png

After Deploy: 

SangNguyen_1-1756696360373.png

I think it would be better if the Workspace UI can have the Job branch to automatically get the value from the Bundle branch without modifying the variable-overrides.json file.

 

 

View solution in original post

8 REPLIES 8

-werners-
Esteemed Contributor III

Is your job definition added to the feature branch too?
It seems like it is not the case.

Hi Weerners, 

Yes, it is as you can see it there (job branch) when I deployed DAB using Databricks CLI command. 

Within the Workspace UI, I saw the Bundle branch is referred to the feature branch, but the Job branch is still referred to the master branch. Is there any option to select the feature branch for the Job branch in Workspace UI?

-werners-
Esteemed Contributor III

It seems that the job was not defined within the bundle but separately (either via cli or UI).
In that case it makes sense.
When creating a bundle, I'd put everything related in that bundle (notebooks, py files, jobs) and check that into git.
Basically there should not be a separate job and bundle branch.
I don't know if that makes sense?

If you use the UI you can always show the generated yml like this (Open configuration):

werners_0-1756215631415.png

 

Coffee77
New Contributor II

Deploying with DAB is completely independent of branch you are using. I usually deploy in my DEV environment with features or DEV branches and everything is OK. I'd say you deployed previous job from master branch and then, you are not updating those jobs but creating new ones (or something similar). So, remember that you must assign same identifiers to deployed resources, by assigning only same names is not OK as new jobs will be created instead of "updating" those with same names. I hope this cloud help.

https://www.youtube.com/@CafeConData

SangNguyen
New Contributor II

Hi @Coffee77

Sorry as I uploaded the wrong screenshot. I used the same feature branch for Dev, so the correct screenshot is below: 

databricks bundle deploy -var="git-branch=sf-trans-seq" -t dev

      SangNguyen_0-1756387981693.png

@-werners- 

I have configured git-branch by default is master, in the dbx.vars.global.yml configuration file.

    SangNguyen_1-1756388139829.png

When deploy DAB with Databricks CLI, the job branch (master by default) can be overwritten by this option: -var="git-branch=sf-trans-seq"

SangNguyen_0-1756387981693.png

However, when deploy DAB in DB Workspace UI, even though I selected the git-branch as the feature branch, but the job branch is still showing the master branch 

SangNguyen_2-1756388914936.png

I am expecting the Workspace UI can also use the git branch for the Job branch as deploying in VS Code, instead of the master by default in my configuration.

Thanks,

 

 

 

-werners-
Esteemed Contributor III

Ok i get it now.
I still find it strange to have a separate branch for the job.
To be honest I work in a complete different way with dab and git.

In my asset bundles I do not define any git branch.
I use git for version control and pull requests of the file objects themselves.
These PRs (and commits) launch devops pipelines which run the DAB deploy & validate.
Works flawless.

SangNguyen
New Contributor II

I found how to add the "git-branch" to override in Workspace UI. 

From Deploy --> Configure variable overrides --> enter the {"git-branch":"sf-trans-seq"} to the variable-overrides.json file.

SangNguyen_0-1756696199388.png

After Deploy: 

SangNguyen_1-1756696360373.png

I think it would be better if the Workspace UI can have the Job branch to automatically get the value from the Bundle branch without modifying the variable-overrides.json file.

 

 

-werners-
Esteemed Contributor III

I agree.

Can you mark your (or someone else´s) answer as solved?  Because I think you won´t be the only one with this issue/feature.