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 ad sp owner list TypeError: Object of type 'bytearray' is not JSON serializable #16123

Open
travis-crowder-kr opened this issue Dec 2, 2020 · 3 comments

Comments

@travis-crowder-kr
Copy link

az ad sp owner list TypeError: Object of type 'bytearray' is not JSON serializable

Command Name
az ad sp owner list

Errors:

Object of type 'bytearray' is not JSON serializable
Traceback (most recent call last):
Local\Temp\pip-unpacked-wheel-2lthyver\knack\cli.py, ln 221, in invoke
Local\Temp\pip-unpacked-wheel-2lthyver\knack\output.py, ln 149, in out
Local\Temp\pip-unpacked-wheel-2lthyver\knack\output.py, ln 41, in format_json
json\__init__.py, ln 238, in dumps
json\encoder.py, ln 201, in encode
json\encoder.py, ln 428, in _iterencode
json\encoder.py, ln 325, in _iterencode_list
json\encoder.py, ln 404, in _iterencode_dict
json\encoder.py, ln 325, in _iterencode_list
json\encoder.py, ln 404, in _iterencode_dict
json\encoder.py, ln 437, in _iterencode
Local\Temp\pip-unpacked-wheel-2lthyver\knack\output.py, ln 33, in default
json\encoder.py, ln 180, in default
TypeError: Object of type 'bytearray' is not JSON serializable

To Reproduce:

  • az ad sp owner list --id {}

Expected Behavior

It to work

Environment Summary

Windows-10-10.0.17763-SP0
Python 3.6.8
Installer: MSI

azure-cli 2.15.1

Additional Context

@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Dec 2, 2020
@yonzhan yonzhan added the Graph az ad label Dec 2, 2020
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Dec 2, 2020
@yonzhan yonzhan removed the question The issue doesn't require a change to the product in order to be resolved. Most issues start as that label Dec 2, 2020
@yonzhan yonzhan added this to the S181 milestone Dec 2, 2020
@yonzhan
Copy link
Collaborator

yonzhan commented Dec 2, 2020

az ad

@yonzhan yonzhan modified the milestones: S181, S182 Dec 31, 2020
@yonzhan yonzhan modified the milestones: S182, S183 Feb 6, 2021
@yonzhan yonzhan modified the milestones: S183 - For Ignite, S184 Feb 26, 2021
@yonzhan yonzhan modified the milestones: S184, S185 Mar 14, 2021
@yonzhan yonzhan modified the milestones: S185, S186 Apr 6, 2021
@yonzhan yonzhan modified the milestones: S186, S187 Apr 23, 2021
@yonzhan yonzhan modified the milestones: S187, S188 May 9, 2021
@yonzhan yonzhan modified the milestones: S188, S189 Jun 12, 2021
@yonzhan yonzhan modified the milestones: S189, Jul 2021 (2021-08-03) Jul 2, 2021
@jsntcy jsntcy closed this as completed Jul 26, 2021
@jsntcy jsntcy reopened this Jul 26, 2021
@jiasli
Copy link
Member

jiasli commented Mar 7, 2022

I can reproduce:

> az ad group member list -g 5e779b14-5559-4e1e-b9ca-0586bc8bb013 --debug
...
msrest.http_logger: Response content:
            ...
            "objectType": "ServicePrincipal",
            "appId": "bce1379e-91fc-4237-8be9-da8450b415f1",
            ...
            "passwordCredentials": [
                {
                    "customKeyIdentifier": "UGFzc3dvcmQhMjNl",

TypeError: Object of type bytearray is not JSON serializable

This issue is because commands like az ad group member list or az ad sp owner list don't have transform_graph_objects_with_cred transform which is applied to commands like az ad sp show or az ad sp credential list:

def transform_graph_objects_with_cred(result):

Of course we can fix this in AD Graph, but our main focus is now on Microsoft Graph (#12946). We won't set customKeyIdentifier after migrating to Microsoft Graph, but set displayName instead (#20561).

However, according to List members API's documentation:

https://docs.microsoft.com/en-us/graph/api/group-list-members?view=graph-rest-1.0&tabs=http

Currently service principals are not listed as group members due to staged roll-out of service principals on Graph V1.0 endpoint. This operation is not transitive.

This seems like a feature gap between AD Graph and Microsoft Graph. We will internally work with Microsoft Graph team on this.

@FlorentATo
Copy link

Any update/status on this feature gap @jiasli ?

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

6 participants