feat: Support Azure Service Principal authentication for Azure DevOps repositories#25324
feat: Support Azure Service Principal authentication for Azure DevOps repositories#25324allanyung wants to merge 27 commits intoargoproj:masterfrom
Conversation
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
|
Looks like the e2e test infra is unstable. The e2e checks have all independently passed, but not in the same CI run. So as to not waste resources, I won't push anymore CI triggers until I hear from a maintainer. Thanks! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #25324 +/- ##
==========================================
+ Coverage 62.61% 62.63% +0.02%
==========================================
Files 353 353
Lines 50147 50314 +167
==========================================
+ Hits 31398 31516 +118
- Misses 15732 15770 +38
- Partials 3017 3028 +11 ☔ View full report in Codecov by Sentry. |
Turns out it was the Cloudflare outage. All passing now 🎉 |
ppapapetrou76
left a comment
There was a problem hiding this comment.
I can't review the UI parts - I only reviewed the golang code
|
@ppapapetrou76 thank you for the review. I've pushed a commit that addresses your comments |
ppapapetrou76
left a comment
There was a problem hiding this comment.
LGTM - thanks for addressing my comments
f58687f to
5d93957
Compare
render repo/cred secrets with new Azure SP values Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
… Principal Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
…esent Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
not sure why my local codegen is reordering them Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
a9776ed to
f81c02d
Compare
ppapapetrou76
left a comment
There was a problem hiding this comment.
I see you added more commits .
When you do so please ask for a new set of reviews
Apologies, you did in fact already review these changes but I rebased and force pushed as master branch advanced and the PR could no longer be cleanly merged. Is this generally the preferred way, or would doing a merge commit of master into my branch be better? |
Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
… issues with expired tokens still being in the cache Signed-off-by: Allan Yung <allan.yung@bbdsoftware.com>
ppapapetrou76
left a comment
There was a problem hiding this comment.
LGTM 🏅 - thanks for addressing my comments
blakepettersson
left a comment
There was a problem hiding this comment.
See #26174, lmk what you think
@blakepettersson I agree with the proposal in principle, however I don't believe it's applicable for the case that this PR aims to solve. The situation we have is:
The K8s clusters are EKS, yet need to auth to Azure DevOps (don't ask 🙈). As such workload identity cannot be used for this, and even if it could, it wouldn't be appropriate as the single identity would need to have access to all tenant repositories. Hope this makes sense and this PR doesn't need heavy modifications |
Currently (speaking of only the Azure part of this) the proposal only accounts for the direct exchange of Azure -> ACR tokens, but I don't see a reason why it couldn't be extended to do EKS (via the EKS OIDC provider) -> Azure -> ACR
The intent of my proposal is to be able to scope identity per app project (by requiring a separate k8s service account for each argo app project that wants to make use of it). |
I'm still failing to see how this would work for Service Principal auth to git repositories - you need to provide I'm not sure how these secrets can be "natively integrated with cloud provider identity systems"
This wouldn't really work for our use case either:
As per my comment above I don't think a service account per project helps as you still need to store the per tenant One of the proposal goals is
Our ideal outcome is that this PR is merged as is and then we would use it in the static credentials way. It's still not clear to me how this would work with the new proposed system, but as long as the method in this PR exists, that's no problem. I'm concerned that if we were not to merge this PR, then what would happen is that an alternative method is introduced that doesn't actually support our requirements. As this PR is not yet an "existing repository" there is then no obligation to maintain support for it. |



Checklist:
Closes #25220
Notes:
I used the GitHub App auth feature #5355 as a reference of how to implement this and followed conventions from there.
I can confirm that in a local build:
argocdCLI can be used to add repositories and templatesAbout tests:
I used the
azure-sdk-for-golibrary. Unfortunately, the design of it means that it's not really possible to override theGetTokenfunction to return a static token rather than attempt to connect to Azure Entra ID. As such there aren't any unit tests. Also, the GitHub App auth PR didn't include any tests either so hopefully this is acceptable