When running your Databricks Jobs, you may want to know on which git commit the job run happened. Here is how get this information during runtime:
- Set the “job.run_id” dynamic value reference as a job parameter.
- Read the parameter during runtime.
- Get the Job run info via Databricks SDK.
- On each task, there is a “git_source.git_snapshot.used_commit” parameter where the git commit of this run is stored.
This is helpful when you want to log or store this information for later review processes or to fulfill any regulatory requirements.
This whole thing is somewhat buried in the API Reference. Link is in the comments.
