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

az login fails with Azure AD service principal and certain client secrets. #12105

Closed
krishjag opened this issue Feb 9, 2020 · 3 comments
Closed
Assignees
Milestone

Comments

@krishjag
Copy link

krishjag commented Feb 9, 2020

When attempting to login using az cli using Azure AD service princiapal, certain client secrets are causing errors.

Here's an example of a client secret that failed and the error message.

az login --service-principal --username <service_principal_application_id> --password "-6fkdUrc:x-]M63JPPosVWJS47cWiiUX" --tenant <azure_ad_tenant_id>

ERROR: az login: error: argument --password/-p: expected one argument
usage: az login [-h] [--verbose] [--debug]
[--output {json,jsonc,table,tsv,yaml,none}] [--query JMESPATH]
[--username USERNAME] [--password PASSWORD]
[--service-principal] [--tenant TENANT]
[--allow-no-subscriptions] [-i] [--use-device-code]
[--use-cert-sn-issuer]

Seems like an issue with the format of the password. I tried the password, enclosing in single-quotes, double-quotes and no-quotes and resulted in the same error message.

@arrownj arrownj added the Account az login/account label Feb 10, 2020
@arrownj
Copy link
Contributor

arrownj commented Feb 10, 2020

Hi @jiasli , could you please help with this ?

@yonzhan yonzhan added this to the S166 milestone Feb 10, 2020
@yonzhan
Copy link
Collaborator

yonzhan commented Feb 10, 2020

add to S166.

@qianwens
Copy link
Member

qianwens commented Mar 8, 2020

@krishjag , this is a known issue in python that the leading character '-' will confusing the argument parser to make it as an option name. #7054 . You can fix this issue by adding '=' between the option name and value : az login --username=$azureUserName --password=$azurePassword

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants