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

{aro} az aro module migration to Microsoft Graph #22549

Merged
merged 2 commits into from
May 31, 2022
Merged

Conversation

nwnt
Copy link
Contributor

@nwnt nwnt commented May 20, 2022

Related command
az aro

Description
Migrating from Azure SDK's AAD Graph to Microsoft Graph
#22174

Testing Guide
All the commands were executed successfully.


This checklist is used to make sure that common guidelines for a pull request are followed.

@ghost ghost requested review from yonzhan and jiasli May 20, 2022 18:31
@ghost ghost added the Auto-Assign Auto assign by bot label May 20, 2022
@ghost ghost requested a review from wangzelin007 May 20, 2022 18:31
@ghost ghost assigned jiasli May 20, 2022
@ghost ghost added this to the Jun 2022 (2022-07-05) milestone May 20, 2022
@ghost ghost added the Graph az ad label May 20, 2022
@ghost ghost requested review from evelyn-ys and calvinhzy May 20, 2022 18:31
@ghost ghost added the AAD label May 20, 2022
@nwnt
Copy link
Contributor Author

nwnt commented May 20, 2022

@jiasli I was unable to re-record new set of live tests - randomly got 404 id not found error after the app was created. As you can see, 8580f82d-d1c6-43bb-af15-57a710bdbc5b does exist.

The behavior was so random as well. The same step is used in different test cases, and sometimes one test would execute successfully, the other will not. This is very very weird.

self = <azure.cli.command_modules.role.msgrpah._graph_client.GraphClient object at 0x7f65633d9e70>
method = 'POST'
url = 'https://graph.microsoft.com/v1.0/applications/8580f82d-d1c6-43bb-af15-57a710bdbc5b/addPassword'
param = None, body = {}

    def _send(self, method, url, param=None, body=None):
        url = self.base_url + url



        if body:
            body = json.dumps(body)

        list_result = []
        is_list_result = False

        while True:
            try:
                r = send_raw_request(self.cli_ctx, method, url, resource=self.resource, uri_parameters=param, body=body)
            except CLIError as ex:
>               raise GraphError(ex.response.json()['error']['message'], ex.response) from ex
E               azure.cli.command_modules.role.msgrpah._graph_client.GraphError: Resource '8580f82d-d1c6-43bb-af15-57a710bdbc5b' does not exist or one of its queried reference-property objects are not present.

../../../role/msgrpah/_graph_client.py:40: GraphError

Untitled

@yonzhan
Copy link
Collaborator

yonzhan commented May 20, 2022

Graph

@jiasli
Copy link
Member

jiasli commented May 23, 2022

@nontw, I have looped you in the internal email for this 404 issue.

The best way to solve it is to time.sleep for a while, like I am doing in role module:

You don't need to worry about its efficiency since it is mocked out during playback.

def patch_time_sleep_api(unit_test):
def _time_sleep_skip(*_):
return
mock_in_unit_test(unit_test, 'time.sleep', _time_sleep_skip)

@nwnt
Copy link
Contributor Author

nwnt commented May 25, 2022

Add test recordings.

@jiasli jiasli changed the base branch from beta to dev May 25, 2022 05:25
@yonzhan
Copy link
Collaborator

yonzhan commented May 25, 2022

Please resolve the conflicting files.

@yonzhan
Copy link
Collaborator

yonzhan commented May 25, 2022

Please resolve the conflicting files

@jiasli jiasli merged commit 8e7c613 into Azure:dev May 31, 2022
@jiasli jiasli changed the title {Graph} az aro module migration to Microsoft Graph {aro} az aro module migration to Microsoft Graph Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AAD Auto-Assign Auto assign by bot Graph az ad
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants