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 acr login does not worked when az login was done with a certificate #6131

Closed
rgreil opened this issue Apr 17, 2018 · 4 comments
Closed

az acr login does not worked when az login was done with a certificate #6131

rgreil opened this issue Apr 17, 2018 · 4 comments
Assignees
Labels
Container Registry az acr Service Attention This issue is responsible by Azure service team.

Comments

@rgreil
Copy link

rgreil commented Apr 17, 2018

When the az login was done with a certificate, the az acr login fails.

Steps to reproduce:

  1. Login with certificate
    az login --service-principal -u http://<service principal> -p <certificate>.pem --tenant <tenant>

  2. Login to ACR
    az acr login -n <registry>

The following error is shown:

'accessToken'
Traceback (most recent call last):
  File "/usr/lib64/az/lib/python2.7/site-packages/knack/cli.py", line 197, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/lib64/az/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 347, in execute
    six.reraise(*sys.exc_info())
  File "/usr/lib64/az/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 319, in execute
    result = cmd(params)
  File "/usr/lib64/az/lib/python2.7/site-packages/azure/cli/core/commands/__init__.py", line 180, in __call__
    return super(AzCliCommand, self).__call__(*args, **kwargs)
  File "/usr/lib64/az/lib/python2.7/site-packages/knack/commands.py", line 109, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/lib64/az/lib/python2.7/site-packages/azure/cli/core/__init__.py", line 420, in default_command_handler
    result = op(**command_args)
  File "/usr/lib64/az/lib/python2.7/site-packages/azure/cli/command_modules/acr/custom.py", line 192, in acr_login
    password=password)
  File "/usr/lib64/az/lib/python2.7/site-packages/azure/cli/command_modules/acr/_docker_utils.py", line 197, in get_login_credentials
    only_refresh_token=True)
  File "/usr/lib64/az/lib/python2.7/site-packages/azure/cli/command_modules/acr/_docker_utils.py", line 154, in _get_credentials
    password = _get_aad_token(cli_ctx, login_server, only_refresh_token, repository, permission)
  File "/usr/lib64/az/lib/python2.7/site-packages/azure/cli/command_modules/acr/_docker_utils.py", line 59, in _get_aad_token
    sp_id, refresh, access, tenant = profile.get_refresh_token()
  File "/usr/lib64/az/lib/python2.7/site-packages/azure/cli/core/_profile.py", line 470, in get_refresh_token
    sp_secret = self._creds_cache.retrieve_secret_of_service_principal(username_or_sp_id)
  File "/usr/lib64/az/lib/python2.7/site-packages/azure/cli/core/_profile.py", line 804, in retrieve_secret_of_service_principal
    return cred[_ACCESS_TOKEN]
KeyError: 'accessToken'

Environment summary

azure-cli (2.0.30)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-14)]
Python (Linux) 2.7.5 (default, May 3 2017, 07:55:04)

@troydai
Copy link
Contributor

troydai commented Apr 17, 2018

@djyou

@djyou
Copy link
Member

djyou commented Apr 17, 2018

@troydai
Copy link
Contributor

troydai commented Apr 17, 2018

@yugangw-msft

@yugangw-msft yugangw-msft self-assigned this Apr 17, 2018
@yugangw-msft yugangw-msft added Account az login/account and removed Container Registry az acr labels Apr 17, 2018
@yugangw-msft yugangw-msft added this to the Sprint 36 (Build) milestone Apr 17, 2018
@yugangw-msft
Copy link
Contributor

yugangw-msft commented Apr 24, 2018

@djyou, i am fixing the crash here. At the same time I don't think ACR is supporting SPs with certificate after cross checked the payload content. So I am leaving this issue open for you to wire up the support at your end. Feel free to let me know if you need details of how to acquire tokens using certificates

@yugangw-msft yugangw-msft assigned djyou and unassigned yugangw-msft Apr 24, 2018
@yugangw-msft yugangw-msft added Container Registry az acr and removed Account az login/account labels Apr 24, 2018
@bsiegel bsiegel added the Service Attention This issue is responsible by Azure service team. label Sep 26, 2018
@haroldrandom haroldrandom added ACR Service Attention This issue is responsible by Azure service team. labels Oct 25, 2019
@ghost ghost added Container Registry az acr and removed ACR labels Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Container Registry az acr Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

6 participants