migueesc123 / PowerBIRESTAPI

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

Gateway refresh issue #38

Closed rhalabi closed 4 years ago

rhalabi commented 4 years ago

I have created a report using this custom connector in PBI desktop and everything works fine connecting as a Power BI Service admin application account. I published report to web service and have setup a gateway connection for refreshing, but I get the error below. I have two gateway servers clustered together. I added custom connector on both gateway servers in connectors section and it shows up, I have allow custom connection gateway checkbox checked, but when refreshing I get error. Any ideas?

image

migueesc123 commented 4 years ago

it appears to be related to the authenticated user used for the call to the table that you have named "Capacity_Dashboards". Could it be that the authenticated user on the gateway isn't the correct one? have you tried clearing those credentials and using a new one?

rhalabi commented 4 years ago

it appears to be related to the authenticated user used for the call to the table that you have named "Capacity_Dashboards". Could it be that the authenticated user on the gateway isn't the correct one? have you tried clearing those credentials and using a new one?

Thx for the reply. You mean on the gateway connection? How do I clear the credential and re-create? All I get is an edit credentials button on the gateway connection, but when I click it I get an initial sign-in screen and then it goes away.

migueesc123 commented 4 years ago

Correct. On the gateway connection. Other than that, you might need to do more troubleshooting to see why the authenticated user doesn't have access to that endpoint. At the Custom Connector level we don't really handle anything related to permissions. This is handled by the API and your webapp. The error raised is simply the direct response from the API for the call made by the authenticated user.

klinejordan commented 4 years ago

For custom connectors using OAuth authentication, the user's credentials must be a gateway admin. See the considerations and limitations: https://docs.microsoft.com/en-us/power-bi/connect-data/service-gateway-custom-connectors#considerations-and-limitations

So if you're using a service account, that account must also be an admin on the gateway.