Usage of Azure DevOps System.AccessToken as PAT in Databricks

arsamkull
New Contributor III

Hi there! I'm trying to use Azure DevOps Pipeline to automate Azure Databricks Repos API. Im using the following workflow:

  • Get an Access Token for a Databricks Service Principal using a Certificate (which works great)
  • Usage REST Api to generate Git Credential using System.AccessToken -> Fails with:

personal_access_token cannot be longer than 100 characters

I grabed the System.AccessToken from Azure DevOps and decoded it using JWT.io and it really is valid JWT. JWT will use a lot more than 100 chars, a resonable max char count would be 2048 (mine is 1118).

Is it possible that Databricks limits the PAT's to 100 chars? Are there alternatives for automating "git pull" using a Service Principal?

requests.post(
 
            f"{BASE_URL}/api/2.0/git-credentials",
 
            json={
 
                "git_provider": "azureDevOpsServices",
 
                "git_username": "DataHub Build Service (ORGNAME)",
 
                "personal_access_token": os.environ["SYSTEM_ACCESSTOKEN"],
 
            },
 
            headers=headers,
 
        )