Skip to content
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

Azure password not working if started with special characters #5058

Closed
jimyjohny opened this issue Dec 7, 2017 · 3 comments

Comments

@jimyjohny
Copy link

commented Dec 7, 2017

Azure login doesn't works if the password is started with special characters. (same works with azure 0.10.1)

OS = Centos 6.x
az version = azure-cli (2.0.22 )

root@xxx:~ /opt/rh/python27/root/usr/bin/az login -u username@domain.com -p @X123456X!
[Errno 2] No such file or directory: 'X123456x!'
Traceback (most recent call last):
File "/opt/rh/python27/root/usr/lib/python2.7/site-packages/azure/cli/main.py", line 36, in main
cmd_result = APPLICATION.execute(args)
File "/opt/rh/python27/root/usr/lib/python2.7/site-packages/azure/cli/core/application.py", line 143, in execute
argv = Application._expand_file_prefixed_files(unexpanded_argv)
File "/opt/rh/python27/root/usr/lib/python2.7/site-packages/azure/cli/core/application.py", line 310, in _expand_file_prefixed_files
return list([Application._expand_file_prefix(arg) for arg in argv])
File "/opt/rh/python27/root/usr/lib/python2.7/site-packages/azure/cli/core/application.py", line 306, in _expand_file_prefix
return Application._maybe_load_file(arg_split[0])
File "/opt/rh/python27/root/usr/lib/python2.7/site-packages/azure/cli/core/application.py", line 295, in _maybe_load_file
return Application._load_file(poss_file)
File "/opt/rh/python27/root/usr/lib/python2.7/site-packages/azure/cli/core/application.py", line 318, in _load_file
allow_binary=True)
File "/opt/rh/python27/root/usr/lib/python2.7/site-packages/azure/cli/core/util.py", line 132, in read_file_content
with codecs_open(file_path, encoding=encoding) as f:
File "/opt/rh/python27/root/usr/lib64/python2.7/codecs.py", line 896, in open
file = builtin.open(filename, mode, buffering)
IOError: [Errno 2] No such file or directory: 'X123456x!'
root@xxx:~

@yugangw-msft

This comment has been minimized.

Copy link
Contributor

commented Dec 7, 2017

The special character gets pre-processed by the shell. To prevent that, please use quote:

az login -u username@domain.com -p '@x123456x!'
@jimyjohny

This comment has been minimized.

Copy link
Author

commented Dec 8, 2017

Its already tried using both single and double quotes. The result is same error message. Seems like it has issue only when using @ as first letter for the password .

@yugangw-msft yugangw-msft reopened this Dec 8, 2017

@yugangw-msft

This comment has been minimized.

Copy link
Contributor

commented Dec 8, 2017

@jimyjohny, thanks for the information, this is caused by that the CLI pre-processes the @ character with the assumption that the subsequent string would be a file name. We should fix it by capturing such exceptions and move on

@yugangw-msft yugangw-msft self-assigned this Jan 4, 2018

@yugangw-msft yugangw-msft added this to the Backlog milestone Jan 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.