source-controller icon indicating copy to clipboard operation
source-controller copied to clipboard

Support Workload Identity in git source controller for Azure DevOps Repos

Open miqm opened this issue 2 years ago • 3 comments

Is there option to use workload identity token as password for git source controller? If not, that would be very helpful. Recently Azure DevOps Repos introduced ability to use Service Principal and Azure Managed Identities to access source code in Azure Repos. However Flux seems not to have ability to work with this, or this is not documented.

Here's doc how to access Repos with Token: https://learn.microsoft.com/en-us/azure/devops/integrate/get-started/authentication/service-principal-managed-identity?view=azure-devops#q-can-i-use-a-service-principal-to-do-git-operations-like-clone-a-repo

miqm avatar Nov 17 '23 08:11 miqm

this is work in progress here https://github.com/fluxcd/pkg/pull/664

souleb avatar Feb 22 '24 10:02 souleb

For those who came here and saw the above message, unfortunately, there has been no more work on this since February, and it looks like it's kind of dead. I may try to put together a PR for this, as it's the biggest blocker for using flux for my team.

hatfarm avatar Apr 15 '24 17:04 hatfarm

I have a working solution, you can create a cron job that generates the token, create secret bearerToken out of generated token. Use this secret as secret in gitRepo object it will work.

dineshkumar181094 avatar May 08 '24 16:05 dineshkumar181094

Prerequisite:

  • https://github.com/fluxcd/flux2/pull/4806
  • https://github.com/fluxcd/pkg/pull/789
  • https://github.com/fluxcd/pkg/pull/793

stefanprodan avatar Jul 31 '24 13:07 stefanprodan

I have a working solution, you can create a cron job that generates the token, create secret bearerToken out of generated token. Use this secret as secret in gitRepo object it will work.

Could you give us a bit more details about that? How did you do? Using the az cli in a cronjob?

chrisdot avatar Aug 30 '24 15:08 chrisdot