Lack of Support for Microsoft Graph in Power Query
Connecting to Microsoft Graph REST APIs from Power Query isn't recommended or supported. Instead, we recommend users explore alternative solutions for retrieving analytics data based on Graph, such as Microsoft Graph data connect.
Users may find they can make certain REST calls to Microsoft Graph API endpoints work through the
OData.Feed functions, but these approaches are not reliable as long-term solutions.
This article outlines the issues associated with Microsoft Graph connectivity from Power Query and explain why it isn't recommended.
The built-in Organizational Account authentication flow for Power Query’s
OData.Feed functions isn't compatible with most Graph endpoints. Specifically, Power Query’s Azure Active Directory (Azure AD) client requests the
user_impersonation scope, which isn't compatible with Graph’s security model. Graph uses a rich set of permissions that aren't available through our generic Web and OData connectors.
Implementing your own Azure AD credential retrieval flows directly from your query, or using hardcoded or embedded credentials, also isn't recommended for security reasons.
OData Libraries’ incompatibility
Certain Graph endpoints and extensions to Graph may require the use of OData libraries and features that aren't supported by Power Query’s built-in
OData.Feed function because Graph and Power Query may be using two different versions of OData libraries. These issues generally result in errors retrieving the service’s $metadata document. Users may discover common guidance related to passing the
Implementation = "2.0" option to the
OData.Feed function call to ensure the latest supported OData libraries are used. While this approach does resolve certain OData incompatibilities, users may still encounter errors over time as Graph and Power Query adopt new versions of the OData libraries at different times.
The Microsoft Graph API is designed to support many application scenarios but is suboptimal for the large-scale data retrieval required for most analytics scenarios. Users trying to retrieve large amounts of data from Graph APIs may encounter performance issues. Details around scenario applicability can be found in the Graph documentation.
Using a custom connector
Some Power Query users have enabled Graph connectivity through custom connectors, limiting their functionality to certain parts of the Graph API. This approach allows connector developers to resolve general authentication issues by defining their own Azure AD client with Graph specific permissions. Some custom connectors work around OData challenges by using
Web.Contents and simulating OData support within their connector logic. However, this approach isn't recommended as users frequently hit the performance and scalability issues described above. Developers who take this route should continue with these limitations in mind.