Throws exception on failure of `az devops user list`
See original GitHub issueDescribe the bug
When I run az devops user list
, I get presented with the traceback from an exception.
Command Name
az devops user list Extension Name: azure-devops. Version: 0.11.0.
Errors:
The command failed with an unexpected error. Here is the traceback:
The requested resource requires user authentication: https://example.vsaex.visualstudio.com/_apis/UserEntitlements?top=100
Traceback (most recent call last):
File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 206, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 603, in execute
raise ex
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 661, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 652, in _run_job
cmd_copy.exception_handler(ex)
File "/home/andreas/.azure/cliextensions/azure-devops/azext_devops/dev/common/exception_handler.py", line 26, in azure_devops_exception_handler
reraise(*sys.exc_info())
File "/opt/az/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 631, in _run_job
result = cmd_copy(params)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 305, in __call__
return self.handler(*args, **kwargs)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 485, in default_command_handler
return op(**command_args)
File "/home/andreas/.azure/cliextensions/azure-devops/azext_devops/dev/team/user.py", line 23, in get_user_entitlements
user_entitlements = client.get_user_entitlements(top=top, skip=skip)
File "/home/andreas/.azure/cliextensions/azure-devops/azext_devops/devops_sdk/v5_0/member_entitlement_management/member_entitlement_management_client.py", line 138, in get_user_entitlements
query_parameters=query_parameters)
File "/home/andreas/.azure/cliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 90, in _send
response = self._send_request(request=request, headers=headers, content=content, media_type=media_type)
File "/home/andreas/.azure/cliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 54, in _send_request
self._handle_error(request, response)
File "/home/andreas/.azure/cliextensions/azure-devops/azext_devops/devops_sdk/client.py", line 254, in _handle_error
url=request.url))
azext_devops.devops_sdk.exceptions.AzureDevOpsAuthenticationError: The requested resource requires user authentication: https://example.vsaex.visualstudio.com/_apis/UserEntitlements?top=100
To Reproduce:
Steps to reproduce the behavior.
az devops user list
Expected Behavior
If the command fails, it should print a friendly message not throw an exception.
Environment Summary
Linux-4.15.0-58-generic-x86_64-with-debian-buster-sid
Python 3.6.5
Shell: bash
azure-cli 2.0.70 *
Extensions:
azure-devops 0.11.0
Additional Context
I probably do not have the appropriate access rights to something.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
is misspelled or not recognized by the system. - Microsoft Q&A
throws exception : ... I got the Id from the az devops project list during the same session. not-supported-azure. Comment. Comment
Read more >Multiple DevOps REST methods throwing 'command failed ...
Fix #2: I was working with two different REST requests, one retrieves a simple list of builds, the other retrieves a simple list...
Read more >Azure DevOps Build Agent not able to access Azure Storage
But when I try to upload the file it throws an error like below. ... default action to apply when no rule matches,...
Read more >Using Azure CLI with PowerShell: error handling explained
Azure Pipelines has a task for using the Azure CLI, but this only has the options to use the command line (.cmd or...
Read more >the urban canuk, eh
You can query the list of Builds and then use Timeline API for each build ... Fear not, there's actually a built in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@lindhe : Thanks for pointing the intent 😃 yes that is an issue and that will be fixed in next release.
Sorry but not able to help with the auth issue you are facing.
I don’t know which permission is required. I’m pretty sure that I should have permission to access it, but I strongly suspect that
az
have gotten something twisted with which id and org that should be used. However, I’m mainly reporting the error because of getting presented with a traceback, not so much because of me fucking up my logins/permissions. 😃No, not literally example.visualstudio.com. Because of NDA, I substituted the real org name with example.
I tried the link you suggested, and that worked fine in my browser. Got some JSON with the correct list.
Here: https://gist.github.com/lindhe/02a1cf257906f5b34d262b2fe3feea68