migueesc123 / PowerBIRESTAPI

A Microsoft Power BI Data Connector or Power Query Connector for the Power BI REST API
MIT License
232 stars 73 forks source link

Gateway not offering AAD authentication #57

Closed lbendlin closed 3 years ago

lbendlin commented 3 years ago

The connector uses the Aad authentication which works very well on the desktop (thank you so much!). However when creating gateway connections the only option is OAUTH. Yes, Aad is a special case of OAUTH but I am still concerned that this may prevent me from using the connector on a gateway. I run some very hard API calls (datasource connection status against 300 connections) and it works fine on the desktop (taking the appropriate amount of time) but it fails to refresh on the gateway. The error message is not clear enough to figure out if it is an issue with the authentication or a timeout issue.

{"error":{"code":"DM_GWPipeline_Gateway_MashupDataAccessError","pbi.error":{"code":"DM_GWPipeline_Gateway_MashupDataAccessError","parameters":{},"details":[{"code":"DM_ErrorDetailNameCode_UnderlyingErrorCode","detail":{"type":1,"value":"-2147467259"}},{"code":"DM_ErrorDetailNameCode_UnderlyingErrorMessage","detail":{"type":1,"value":"Unable to connect to the remote server"}},{"code":"DM_ErrorDetailNameCode_UnderlyingHResult","detail":{"type":1,"value":"-2147467259"}},{"code":"Microsoft.Data.Mashup.ValueError.Detail","detail":{"type":1,"value":"https://api.powerbi.com/v1.0/myorg/gateways"}},{"code":"Microsoft.Data.Mashup.ValueError.Reason","detail":{"type":1,"value":"DataSource.Error"}}],"exceptionCulprit":1}}} Table: Gateway Data Sources.

Cluster URI: | WABI-WEST-US-C-PRIMARY-redirect.analysis.windows.net Activity ID: | 9df6c02a-57e1-46b0-b1c3-8f0c2c2e78ea Request ID: | 2b0cacf9-5698-160b-2f54-2d59c99951be Time: | 2021-04-27 11:51:30Z

migueesc123 commented 3 years ago

Hey! The error is not related to the authentication, but to a series of queries in your data model that result in some errors.

One of those queries is for the table with the name Gateway Data Sources.. The part that reads Unable to connect to the remote server suggests that it was a timeout or perhaps a handshake issue during one of the calls to the API.

The Aad authentication was recently implemented by MSFT as the go-to option when connectitng to data sources from the MSFT cloud that rely in Azure Active Directory. It uses an application and permissions defined by MSFT themselves and, when the connector goes through certification, it also has some even tighter integrations with the Power BI cloud for even more secure refreshes. Since the connector is not certified, you need to use the gateway.

If your suggesttion is that the Aad authentication should change it's label to something else in the Power BI Service to be something other than "OAuth", then I recommend that you publish this request directly to the MSFT team on their repo from the link below: https://github.com/microsoft/DataConnectors/