Skip to content

add support for CLI credentials when uploading to Azure - #2745

Merged
supakeen merged 3 commits into
osbuild:mainfrom
ondrejbudai:azure-cli
Oct 8, 2026
Merged

supakeen merged 3 commits into
osbuild:mainfrom
ondrejbudai:azure-cli

Conversation

@ondrejbudai

Copy link
Copy Markdown
Member

I needed to test some Azure uploads, I had az installed and authenticated, and I was wondering why image-builder cannot just re-use the credentials. Instead it "wanted" me to create a service account...

Turns out the azure sdk has support for using the CLI credentials, so I plumbed it through our azure library and through the CLI layer.

I tested this locally, and it's quite convenient. And it brings parity to what the AWS integration can do.

@ondrejbudai
ondrejbudai requested a review from a team as a code owner October 6, 2026 14:36
Comment thread cmd/image-builder/cmd.go Resolved
croissanne
croissanne previously approved these changes Oct 7, 2026

@croissanne croissanne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, thank you. I agree with Brian though that maybe splitting the description into short and long could be nicer.

@avitova avitova left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤏 nitpick

Comment thread doc/01-usage.md Resolved
@ondrejbudai

Copy link
Copy Markdown
Member Author

I moved the big description to Long. The long description for build now feels a bit weird because it talks mainly about uploads, but I guess we can take a second look at this in a follow-up and tried to improve the build docs overall.

@supakeen
supakeen enabled auto-merge October 8, 2026 07:12
I would like to introduce multiple ways to do Azure authentication. In
order to prepare for this, I factored out a method responsible for
creating a client that takes a generic TokenCredential instead of the
specific ClientSecret one.
If the credentials arg is empty, let's default to the CLICredential,
i.e. image-builder will re-use the authentication from the azure CLI
(use az login to initialize it).

This is nice for developer experience because they don't have service
credentials lying around - but it's simple for them to authenticate az.
The previous commit added support to the azure library for using the CLI
credentials, this commit wires it up to the CLI. This means
image-builder can now re-use the same credentials as azure-cli uses on
my machine which I found pretty neat.
@ondrejbudai

Copy link
Copy Markdown
Member Author

Rebased to fix the failing Check for valid snapshot urls test.

@supakeen
supakeen added this pull request to the merge queue Oct 8, 2026
Merged via the queue into osbuild:main with commit 1c5c1e2 Oct 8, 2026
55 checks passed
@ondrejbudai
ondrejbudai deleted the azure-cli branch October 8, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants