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.
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.
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?
…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.