GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ACR Login: Use Azure SDK library to get the credential and token by dbalseiro · Pull Request #3398 · knative/func

Conversation

@dbalseiro

@dbalseiro dbalseiro commented Jan 26, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Add Azure SDK for Go as a dependency
  • Use Azure SDK for GO to get credentials and token to log in to [Azure Container Registry[(https://learn.microsoft.com/en-us/cli/azure/msal-based-azure-cli?view=azure-cli-latest)

/kind bug

Fixes #3288

Release Note

`func` no longer relies on Azure CLI’s deprecated `accessToken.json` file to authenticate with Azure Container Registry. Authentication now uses Azure’s supported credential mechanisms (e.g. Azure CLI, environment credentials, managed identity). No action is required for most users.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@knative-prow knative-prow Bot added do-not-merge/work-in-progress 🤖 PR should not merge because it is a work in progress. kind/bug Bugs labels Jan 26, 2026
@knative-prow
knative-prow Bot requested review from dsimansk and jrangelramos January 26, 2026 18:57
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jan 26, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: dbalseiro / name: Diego Balseiro (4499b14, 8347f44)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow

knative-prow Bot commented Jan 26, 2026

Copy link
Copy Markdown

Welcome @dbalseiro! It looks like this is your first PR to knative/func 🎉

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow

knative-prow Bot commented Jan 26, 2026

Copy link
Copy Markdown

Hi @dbalseiro. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow knative-prow Bot added needs-ok-to-test 🤖 Needs an org member to approve testing size/XS 🤖 PR changes 0-9 lines, ignoring generated files. labels Jan 26, 2026
@knative-prow knative-prow Bot added size/M 🤖 PR changes 30-99 lines, ignoring generated files. and removed size/XS 🤖 PR changes 0-9 lines, ignoring generated files. labels Feb 3, 2026
@dbalseiro
dbalseiro marked this pull request as ready for review February 3, 2026 22:11
@knative-prow knative-prow Bot removed the do-not-merge/work-in-progress 🤖 PR should not merge because it is a work in progress. label Feb 3, 2026
@lkingland

lkingland commented Feb 9, 2026

Copy link
Copy Markdown
Member

/ok-to-test

Thanks for the PR!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow knative-prow Bot added ok-to-test 🤖 Non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test 🤖 Needs an org member to approve testing labels Feb 9, 2026
@dbalseiro dbalseiro mentioned this pull request Feb 10, 2026
Use Azure SDK library to get the credential and token stackbuilders/func#2
Closed
@codecov

codecov Bot commented Feb 17, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.54%. Comparing base (94711b0) to head (8ebe95c).
⚠️ Report is 32 commits behind head on main.

Files with missing lines Patch % Lines
pkg/k8s/keychains.go 0.00% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3398      +/-   ##
==========================================
+ Coverage   54.50%   54.54%   +0.03%     
==========================================
  Files         173      179       +6     
  Lines       19694    20260     +566     
==========================================
+ Hits        10735    11051     +316     
- Misses       7836     8037     +201     
- Partials     1123     1172      +49     
Flag Coverage Δ
e2e 38.43% <0.00%> (+0.48%) ⬆️
e2e go 32.64% <0.00%> (-0.98%) ⬇️
e2e node 28.55% <0.00%> (-0.75%) ⬇️
e2e python 32.15% <0.00%> (-0.98%) ⬇️
e2e quarkus 28.67% <0.00%> (-0.77%) ⬇️
e2e rust 28.11% <0.00%> (-0.72%) ⬇️
e2e springboot 26.54% <0.00%> (-0.72%) ⬇️
e2e typescript 28.66% <0.00%> (-0.75%) ⬇️
integration 17.53% <0.00%> (+0.96%) ⬆️
unit macos-14 42.25% <0.00%> (-1.05%) ⬇️
unit macos-latest 42.25% <0.00%> (-1.05%) ⬇️
unit ubuntu-24.04-arm 42.56% <0.00%> (-1.06%) ⬇️
unit ubuntu-latest 43.14% <0.00%> (-1.08%) ⬇️
unit windows-latest 42.27% <0.00%> (-1.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lkingland
lkingland approved these changes Feb 17, 2026
View reviewed changes

@lkingland lkingland left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I have one minor improvement worth at least exploring the feasability of (plumbing through a context object) and one concern worth double-checking (that there's no other code depending on creds.ErrCredentialsNotFound being returned).

/approve
/hold pending possible changes per the above

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkg/k8s/keychains.go Outdated
}, nil
}
scope := "https://containerregistry.azure.net/.default"
token, err := azCredentials.GetToken(context.Background(), policy.TokenRequestOptions{

@lkingland lkingland Feb 17, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to plumb through a context object to GetACRCredentialLoader in case this thing can lock up or need canceling.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@dbalseiro dbalseiro Mar 14, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

giving it a try :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkg/k8s/keychains.go
if err != nil {
return oci.Credentials{}, fmt.Errorf("failed to get azure access token: %w", err)
}
return oci.Credentials{}, creds.ErrCredentialsNotFound

@lkingland lkingland Feb 17, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I notice that creds.ErrCredentialsNotFound is no longer returned. This sentinel value may be depended upon by other systems to fall-through (despite using error types as flow-control being an antipattern; it's life). It might be a good idea to double-check that there's no other code depending on exactly that error type to ensure we're not breaking any "error fallback" systems if one of the other generic errors is returned instead.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@dbalseiro dbalseiro Mar 13, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we are still returning ErrCredentialsNotFound when the registry's domain is not azure.io. And if I'm not mistaken, returning ErrCredentialsNotFound in this line made sense at the time, because it was trying to fetch the token from a JSON file. But now we try to generate the token using the SDK. I think if the SDK fails, we should return a plain error. What do you think?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@knative-prow knative-prow Bot added the do-not-merge/hold 🤖 PR should not merge because someone has issued a /hold command. label Feb 17, 2026
@knative-prow knative-prow Bot assigned lkingland Feb 17, 2026
@knative-prow knative-prow Bot added lgtm 🤖 PR is ready to be merged. approved 🤖 PR has been approved by an approver from all required OWNERS files. labels Feb 17, 2026
@knative-prow knative-prow Bot added size/L 🤖 PR changes 100-499 lines, ignoring generated files. and removed lgtm 🤖 PR is ready to be merged. size/M 🤖 PR changes 30-99 lines, ignoring generated files. labels Mar 14, 2026
dbalseiro
dbalseiro commented Mar 14, 2026
View reviewed changes

@dbalseiro dbalseiro left a comment

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lkingland Thanks for the review! Sorry it took me so long to do it, but I addressed your comments. Let me know what you think.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkg/k8s/keychains.go
if err != nil {
return oci.Credentials{}, fmt.Errorf("failed to get azure access token: %w", err)
}
return oci.Credentials{}, creds.ErrCredentialsNotFound

@dbalseiro dbalseiro Mar 13, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we are still returning ErrCredentialsNotFound when the registry's domain is not azure.io. And if I'm not mistaken, returning ErrCredentialsNotFound in this line made sense at the time, because it was trying to fetch the token from a JSON file. But now we try to generate the token using the SDK. I think if the SDK fails, we should return a plain error. What do you think?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkg/k8s/keychains.go Outdated
}, nil
}
scope := "https://containerregistry.azure.net/.default"
token, err := azCredentials.GetToken(context.Background(), policy.TokenRequestOptions{

@dbalseiro dbalseiro Mar 14, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

giving it a try :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dbalseiro
dbalseiro requested a review from lkingland March 18, 2026 21:47
@lkingland

lkingland commented Apr 21, 2026

Copy link
Copy Markdown
Member

/ok-to-test

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lkingland

lkingland commented Apr 21, 2026

Copy link
Copy Markdown
Member

Where's all our tests I wonder?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dbalseiro

dbalseiro commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

/retest

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dbalseiro

dbalseiro commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

@gauron99 you were right I had force-pushed a bad rebase :( Now everything is how it's supposed to be

We are using a version of this in our project and I'd greatly appreciate if it can go upstream. Thanks for your time!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow-robot knative-prow-robot added the needs-rebase Cannot be merged due to conflicts with HEAD. label Sep 18, 2026
@dbalseiro
dbalseiro force-pushed the acr-login-with-sdk branch from 721088b to 8347f44 Compare September 21, 2026 21:14
@knative-prow-robot knative-prow-robot removed the needs-rebase Cannot be merged due to conflicts with HEAD. label Sep 21, 2026
@dbalseiro

dbalseiro commented Sep 21, 2026

Copy link
Copy Markdown
Contributor Author

/retest

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dbalseiro

dbalseiro commented Oct 14, 2026

Copy link
Copy Markdown
Contributor Author

@gauron99 @lkingland Just bumping this one in case it got buried. The PR is rebased and ready for another look. We’re already using this change in our project, so it’d be great to get it upstream. Happy to address any remaining concerns to unblock the merge. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gauron99

gauron99 commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

@dbalseiro hi, thanks for the reminder, indeed these get buried quite easily lately, sorry about that.

It seems there is a review dog error flagged so far, I'll take a look at the code hopefully today.

What project are you using func in? if its not a secret 🙂

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dbalseiro

dbalseiro commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

I'm not sure I can disclose the project. But it's an internal low-code platform for a US law firm. We primarily use functions but have been playing a little bit with knative services lately.

I'll address the linting errors :) thank you

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dbalseiro

dbalseiro commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

/retest

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gauron99

gauron99 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

/cla

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gauron99

gauron99 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

/easycla

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gauron99

gauron99 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

@dbalseiro hey it seems the cla check is failing now, once fixed
otherwise!
/lgtm
/approve

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow knative-prow Bot assigned gauron99 Oct 19, 2026
@knative-prow knative-prow Bot added the lgtm 🤖 PR is ready to be merged. label Oct 19, 2026
@gauron99

gauron99 commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

@lkingland in case you have some pointers as you have reviewed this before

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dbalseiro
dbalseiro force-pushed the acr-login-with-sdk branch from 85f8816 to 4499b14 Compare October 19, 2026 15:32
@knative-prow knative-prow Bot removed the lgtm 🤖 PR is ready to be merged. label Oct 19, 2026
@dbalseiro

dbalseiro commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

@gauron99 sorry I had commited with my "work" email... I amended the author of my last commit now and CLA is passing

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dbalseiro added 2 commits October 20, 2026 11:21
@dbalseiro dbalseiro
ACR Login: Use Azure SDK library to get the credential and token
2b9ccb9
@dbalseiro dbalseiro
Address reviewdog linting errors
b1b14eb
@dbalseiro
dbalseiro force-pushed the acr-login-with-sdk branch from 4499b14 to b1b14eb Compare October 20, 2026 16:22
@dbalseiro

dbalseiro commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

/retest

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dbalseiro

dbalseiro commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

@gauron99 rebased and tests passing

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@gauron99

gauron99 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

/lgtm
/approve

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow knative-prow Bot added the lgtm 🤖 PR is ready to be merged. label Oct 22, 2026
@knative-prow

knative-prow Bot commented Oct 22, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dbalseiro, gauron99, lkingland

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

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [gauron99,lkingland]

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@lkingland

lkingland commented Oct 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Agreed on a plain error being the right call.
/hold cancel

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow knative-prow Bot removed the do-not-merge/hold 🤖 PR should not merge because someone has issued a /hold command. label Oct 28, 2026
@knative-prow
knative-prow Bot merged commit fb9317e into knative:main Oct 28, 2026
45 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@dsimansk dsimansk Awaiting requested review from dsimansk
@jrangelramos jrangelramos Awaiting requested review from jrangelramos
@lkingland lkingland Awaiting requested review from lkingland

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@gauron99 gauron99

@lkingland lkingland

Labels

approved 🤖 PR has been approved by an approver from all required OWNERS files. kind/bug Bugs lgtm 🤖 PR is ready to be merged. ok-to-test 🤖 Non-member PR verified by an org member that is safe to test. size/L 🤖 PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Azure Container Repository Login Fails

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@dbalseiro @lkingland @gauron99 @knative-prow-robot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.