Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ def login_auth_for_azcopy(cmd):


def client_auth_for_azcopy(cmd, client):
# 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"):

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.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added more cases

raw_token = Profile(cli_ctx=cmd.cli_ctx).get_raw_token(resource=STORAGE_RESOURCE_ENDPOINT)
token_info = raw_token[0][2]
try:
Expand Down