Skip to content

Commit fbc2732

Browse files
committed
fix case where user is not logged in but want to use azcopy with account-key
1 parent 617ddcf commit fbc2732

File tree

1 file changed

+2
-2
lines changed
  • src/azure-cli/azure/cli/command_modules/storage/azcopy

1 file changed

+2
-2
lines changed

src/azure-cli/azure/cli/command_modules/storage/azcopy/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ def login_auth_for_azcopy(cmd):
146146

147147

148148
def client_auth_for_azcopy(cmd, client):
149-
# prefer oauth mode
150-
if client.credential:
149+
# prefer oauth mode, if account-key is not provided
150+
if client.credential and not hasattr(client.credential, "account_key"):
151151
raw_token = Profile(cli_ctx=cmd.cli_ctx).get_raw_token(resource=STORAGE_RESOURCE_ENDPOINT)
152152
token_info = raw_token[0][2]
153153
try:

0 commit comments

Comments
 (0)