cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to do without the github token and integration?

kg6ka
New Contributor

Hey, guys.
I have a question, so, I have databricks jobs in workflow that are linked to my databricks repo, which contains the necessary scripts for one or another job. That is, the job is linked to the databricks repo.
The main code is developed in github and at the moment of release github action is triggered and pushed the code to databricks repo by means of rest api (according to your docs). But in order to push code in databricks repo it turns out that github integration is needed, which is strange. I'm not going to create webhooks or so on and I just need to push code from github to databricks repo, but it doesn't work and I get this error message
'{"error_code": "PERMISSION_DENIED", "message": "Missing Git provider credentials. Go to User Settings > Git Integration to set up your Git credentials."}'
So, how can I push code from github to databricks repo without git integration and just using databricks token?

Use POST /api/2.0/repos and PATCH /api/2.0/repos/{repo_id} for creation and updation -> https://docs.databricks.com/api/workspace/repos/update

 

Thanks,
Best.

2 REPLIES 2

User16752239289
Valued Contributor
Valued Contributor

Does the user which the API token is generated from has the git credential configured for the git repo ?

If not, you can follow the steps here : https://docs.databricks.com/en/repos/get-access-tokens-from-git-provider.html

 

Kaniz
Community Manager
Community Manager

Hi @kg6kaBased on the provided information, you are trying to push code from Github to Databricks repo using Databricks REST API.

However, the error message you are getting indicates that you are missing Git provider credentials. 

According to the Databricks documentation, you need to set up Git Integration in your user settings to push code to Databricks repo. This is required because Databricks needs to authenticate with the Git provider to gain access to the repository. 

However, you mentioned using Databricks token instead of setting up Git integration. Unfortunately, it's not possible to bypass the Git integration requirement using the Databricks token. The Databricks token is used to authenticate with the Databricks REST API, but it does not provide the credentials for Databricks to access the Git repository. 

So, to resolve the issue, you would need to set up Git Integration in your Databricks user settings. You can follow the instructions in the Databricks documentation to do so. 

Sources:
- [Databricks CI/CD Techniques with Repos](https://docs.databricks.com/repos/ci-cd-techniques-with-repos.html)
- [Databricks CI/CD with GitHub Actions](https://docs.databricks.com/dev-tools/bundles/ci-cd.html)
- [Databricks Error Message](https://kb.databricks.com/machine-learning/mlflow-invalid-access-token-error)

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.