Reputation: 1
I have a REST API Server configured for Basic authentication. I have configured a Power BI report in PowerBI Desktop to read from this REST API. I've setup the Data Source Setting in Power BI as anonymous and then pass the Basic authentication key through the web contents headers.
This works fine. Then I publish the PowerBI report to My Workspace at PowerBi Service to be able to share this report with other users and schedule the dataset refresh. I've installed the on-prem data gateway in a VM that has both access to PowerBI Service and also access to the REST API. I assume that the credentials should be the same as in the Data Source Settings in PowerBI desktop. Since I use anonymous in PBI desktop then I use the same in the PBI service and use the authentication web contents headers for Basic authentication. However 'm getting the following error:
Failed to update data source credentials: The credentials provided for the Web source are invalid. (Source at https://**********/piwebapi.)
Have you experienced something similar? Thanks!
I tried also configuring Basic at PBI Service, and they are accepted. However when I try to refresh the dataset I get the following error: "Web.Contents with the Content option is only supported when connecting anonymously."
Upvotes: 0
Views: 2761
Reputation: 89091
"POST requests may only be made anonymously."
https://learn.microsoft.com/en-us/powerquery-m/web-contents
And Power BI will not allow you to paste plain-text credentials into your query when refreshing through the service. IE you can't make a BASIC auth call with credentials by writing your own Authentication header.
So the only option to use the Web.Contents connector is to pass the request entirely in the query string or HTTP headers when using a non-Anonymous request.
Upvotes: 2