You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
msgraph-beta-sdk-python calling v1.0 endpoint instead of beta after dependency update #743
Basically the issue is as the title - a number of scripts using msgraph-beta-sdk-python failed after updating some of the dependencies with pip. On investigation this appears to be because the request are being directed to https://graph.microsoft.com/v1.0/ instead of https://graph.microsoft.com/beta/
Nothing special needs to be done to replicate the issue - create a GraphServiceClient and either try to use it or print out path_parameters['base_url'] and you will see it is using the v1.0 endpoint and not the beta one.
I'm facing this same issue (actually I started with an Ansible issue, and now I'm 3 issues deep in trying to add a Managed Identity to a group LOL) - msgraph_beta.GraphServicesClient calls the https://graph.microsoft.com/v1.0//groups/xxxxxxxxxxxxxxxxxxxxxxxxx/members endpoint. I only just noticed the two slashes in there.
BUT - how do you explicitly set the base url? I don't see any mention of it in the parameters for GraphServiceClient or any of it's base classes...
This looks like it changes it, but the resulting queries still go to the wrong URL
I've mostly switched away from this library as I wasn't impressed that something could be so fundamentally broken and they both didn't notice before release, and haven't seemed to show any interest in fixing it. However, looking back it seems like this workaround might work for you:
hehe thanks. I have to admit that my original take was that the combination of lightly-documented autogenerated query builder classes and async was massive overkill for my simple use case, and I wrote my own little client. The only reason I am here again is that Ansible uses it, too.
(the second (request_adapter) change does indeed switch it over)
Activity
howardjones commentedon May 16, 2025
I'm facing this same issue (actually I started with an Ansible issue, and now I'm 3 issues deep in trying to add a Managed Identity to a group LOL) - msgraph_beta.GraphServicesClient calls the https://graph.microsoft.com/v1.0//groups/xxxxxxxxxxxxxxxxxxxxxxxxx/members endpoint. I only just noticed the two slashes in there.
BUT - how do you explicitly set the base url? I don't see any mention of it in the parameters for GraphServiceClient or any of it's base classes...
This looks like it changes it, but the resulting queries still go to the wrong URL
rkerr commentedon May 16, 2025
I've mostly switched away from this library as I wasn't impressed that something could be so fundamentally broken and they both didn't notice before release, and haven't seemed to show any interest in fixing it. However, looking back it seems like this workaround might work for you:
I can't remember why you need to set it in two different places anymore.
howardjones commentedon May 16, 2025
hehe thanks. I have to admit that my original take was that the combination of lightly-documented autogenerated query builder classes and async was massive overkill for my simple use case, and I wrote my own little client. The only reason I am here again is that Ansible uses it, too.
(the second (request_adapter) change does indeed switch it over)