- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 06:45 AM - edited 02-27-2024 06:46 AM
Hello all!
I've been working on integrating a Databricks Repos update API call to a DevOps Pipeline so that the Databricks local repo stays up to date with the remote staging branch (Pipeline executes whenever there's a new commit in to the staging branch). Everything seems to work fine (request returns 200), but for some reason, after the pipeline executes, the Databricks local repo has yet to perform the git pull operation.
I tried checking out to main and then staging to see if it would work, but it didn't change anything.
The weird thing is that if I run the same code using Postman or python, the repo gets updated as expected.
Here's the pipeline's code:
task: PythonScript@0
inputs:
scriptSource: 'inline'
script: |
import requests as rq
import os
access_token = os.environ["DATABRICKS_TOKEN_GENERATOR_ACCESS_TOKEN"]
url = "$(databrick-hostname)/api/2.0/repos/$(repo-id)"
headers = {'Authentication': f'Bearer {access_token}'}
data = '{"branch": "main"}'
response = rq.patch(url, headers=headers, data = data)
data = '{"branch": "staging"}'
response = rq.patch(url, headers=headers, data = data)
print(response)
displayName: 'Update Staging project'
Any clues as to where I might be messing up?
Thanks in advance!