This repository has been archived by the owner on Aug 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
fix: Fixed azure cli authorization #461
Open
amanenk
wants to merge
3
commits into
cloudquery:main
Choose a base branch
from
amanenk:fix_auth
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
@amanenk Does this fix the principal auth issue, or only report the error to the user earlier? Looking at this doc, it looks like we may want to try using
DefaultAzureCredential
. Maybe we should even put it in aChainedTokenCredential
to fit with Azure's SDK conventionsThere 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.
Ah, I'm reading the error message from the original issue more carefully now, and it suggests that the issue was that the
az
CLI wasn't found on the path. So what you're doing here is checking that we can auth using that method, and if not, falling through to environment variables. I see! I still think we may want to use aChainedTokenCredential
instead, so that the Azure SDK will go through all the auth options for us if one fails.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.
@amanenk I also made an attempted fix here, using the default credential chain: cloudquery/cloudquery#1283
Let's chat about how we want to proceed: perhaps we can release your fix as a release here (the final one to be released on this repo), and the default credential one only on the monorepo, since that's also a breaking change.