-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[Storage] Fix #32048: az storage blob sync: Fix using azcopy with account-key without login into azcli
#32127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
️✔️AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
az storage blob sync: Fix case where user is not logged in but want to use azcopy with account-keyaz storage blob sync: Fix using azcopy with account-key without logging into azcli
az storage blob sync: Fix using azcopy with account-key without logging into azcliaz storage blob sync: Fix using azcopy with account-key without logging into azcli
az storage blob sync: Fix using azcopy with account-key without logging into azcliaz storage blob sync: Fix using azcopy with account-key without logging into azcli
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.
Pull Request Overview
This PR fixes an issue where az storage blob sync fails when using azcopy with account-key authentication without being logged into Azure CLI. The fix modifies the authentication logic to prevent attempting OAuth authentication when an account key is explicitly provided.
- Modified authentication logic to check if account-key credential is being used
- Updated comment to clarify the authentication preference behavior
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
az storage blob sync: Fix using azcopy with account-key without logging into azcliaz storage blob sync: Fix using azcopy with account-key without login into azcli
| # prefer oauth mode | ||
| if client.credential: | ||
| # prefer oauth mode, if account-key is not provided | ||
| if client.credential and not hasattr(client.credential, "account_key"): |
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.
Is it possible that client.credential is just a dict containing account_key so that hasattr() won't work?
Or is it possible that credential has sth else, eg SAS token or connection string so that no OAuth is needed?
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.
Added more cases
…ssed in as a dict
Related command
Description
Fix #32048
az storage blob sync: Fix using azcopy with account-key without logging into azcliTesting Guide
History Notes
[Storage] Fix #32048:
az storage blob sync: Fix using azcopy with account-key without login into azcliThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.