Skip to content

Add Azure Workload Identity Federation auth for Azure DevOps#996

Open
namnt2307 wants to merge 1 commit into
kubernetes:masterfrom
namnt2307:azure-workload-identity
Open

Add Azure Workload Identity Federation auth for Azure DevOps#996
namnt2307 wants to merge 1 commit into
kubernetes:masterfrom
namnt2307:azure-workload-identity

Conversation

@namnt2307

Copy link
Copy Markdown

What

Adds a secretless authentication mode for Azure DevOps Services repos using Azure Workload Identity Federation. When --azure-workload-identity is set, git-sync exchanges the pod's projected ServiceAccount token with Microsoft Entra ID for a short-lived access token and uses it as the git credential — no PAT, SSH key, or long-lived secret is stored. Mirrors the existing GitHub App auth mode.

Why

Implements the request in #955: environments whose policies forbid PATs currently can't use git-sync with Azure DevOps even when the workload identity already has repo access.

Config

New flags (each with GITSYNC_* and AZURE_* env fallbacks):

  • --azure-workload-identity — opt in
  • --azure-client-id / --azure-tenant-id / --azure-federated-token-file / --azure-authority-host — default to the AZURE_* vars injected by the azure-workload-identity webhook; overridable as flags
  • --azure-scope — defaults to the Azure DevOps resource ID

Docs in docs/azure-workload-identity.md; flags documented in README.md.

Testing

Ref #955

Add a secretless auth mode for Azure DevOps repos using Azure Workload
Identity Federation. The pod's projected ServiceAccount token is exchanged
with Microsoft Entra ID for an access token, which is stored as the git
credential. Enabled with --azure-workload-identity; client ID, tenant ID,
token file, authority host, and scope are configurable via flags, each
falling back to the AZURE_* env vars injected by the azure-workload-identity
webhook. Mirrors the existing GitHub App auth mode.
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: namnt2307
Once this PR has been reviewed and has the lgtm label, please assign stp-ip for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubernetes-prow kubernetes-prow Bot requested a review from sdowell July 14, 2026 05:04
@kubernetes-prow kubernetes-prow Bot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 14, 2026
@kubernetes-prow kubernetes-prow Bot requested a review from stp-ip July 14, 2026 05:04
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Welcome @namnt2307!

It looks like this is your first PR to kubernetes/git-sync 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/git-sync has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@kubernetes-prow kubernetes-prow Bot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant