Forum Discussion
Invalid Connection Credentials When Adding API to On‑premises Data Gateway
- 1 year ago
Power BI Gateway Data Refresh Issue Resolution
Troubleshooting Steps
During a support call with Microsoft, assistance was provided and various tests were conducted to diagnose the issue.
The solution involved creating a Generation 1 (Gen1) dataflow in Power BI. In this dataflow, a table was created to store the token generation link.
The M code used in Power Query in Power BI Desktop was copied and pasted into the dataflow to enable data retrieval via the alternate link (this alternate link had been preventing the on-premises data gateway from refreshing data in the Power BI Service).
Once the dataflow connection was added in the on-premises data gateway, the Power BI Service scheduled refresh was able to update the data successfully.
Thankyou, lbendlin, for your response.
Hi ihavequestionto,
We appreciate your inquiry submitted through the Microsoft Fabric Community Forum.
As per my understanding, the issue arises because Power BI Service and Gateway require a valid and reachable Base URL during data refresh. In your case, accessing only api.mktzap.com.br/ returns a "404 Not Found" error, which leads to the gateway authentication failure. While Power BI Desktop may sometimes handle this scenario more leniently, the Service necessitates a successful connection even to the base URL.
Kindly follow the steps below, which may help to resolve the issue:
- Update your API connection so that the Base URL points to a valid path—for example, api.mktzap.com.br/company/ instead of the root URL alone.
- Use the RelativePath and Query options to append the specific endpoint (such as /historycontact) and any query parameters like x-page.
- Ensure that in Power BI Service, the Authentication Method is set to Anonymous (particularly if you are using Bearer tokens in the headers) and the Privacy Level is set to None.
If you find our response helpful, kindly mark it as the accepted solution and provide kudos. Your support will be beneficial to other community members encountering similar queries.
Thank you.