alexott / databricks-nutter-repos-demo

Demo of using the Nutter for testing of Databricks notebooks in the CI/CD pipeline

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Service principal authenticate with AAD token to Azure Devops repo?

baatch opened this issue · comments

commented

Hi @alexott

  • Is it impossible to authenticate service principal with AAD token to Azure Devops repo?

  • For Azure Devops repo configuration with Azure Devops PAT, how do you configure this for a service principal?

Yes, right now it's impossible to use service principal to authenticate to Azure DevOps (at least this doc lists only user-related tokens).

For 2nd item - right now it's not possible to set DevOps PAT for service principal as corresponding REST API is missing. As I understand it should be added in the near future

commented

@alexott thank you for confirming 👍

commented

@alexott is it possible to create the root repo folder with api or cli ? I cannot seem to find a way to do it and your instructions are to manually pre create them.

Yeah, it’s not obvious because you need to use workspace API or cli command:

databricks workspace mkdirs /Repos/directory

It’s easier a bit with terraform that creates intermediate directories automatically. Like this: https://gist.github.com/alexott/6a8740e6757e2ac0c6ffc3672afdf2a6

commented

@alexott thnx for sharing, now I need to learn Terraform 😄

It was just an example. You can use Databricks CLI as I have shown

commented

Yeah I know, but now I have a reason to go learn Terraform 😂

Thanks for some of this! I had spent the last few weeks trying to get the authentication between Azure Databricks and Azure DevOps to work and couldn't find examples of it or how to get it to work.
I kept getting this error:
{"error_code":"PERMISSION_DENIED","message":"Invalid Git provider credentials. Go to User Settings > Git Integration to ensure that:\n1. You have entered a username with your Git provider credentials.\n2. You have selected the correct Git provider with your credentials.\n3. Your personal access token or app password has the correct repo access.\n4. If you have SSO enabled with your Git provider, be sure to authorize your token."}

Any updates on when this changes would be appreciated!

Unfortunately, right now it's only possible to authenticate using Azure DevOps PAT, not service principal ID/secret

@matthieumarshall Git Credentials API was just released, so you can now set DevOps PAT for service principal as well