cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aliii1984
Regular Visitor

Adding a header to a web API request in the data sources section of a report in PBI Report Server

Hello everyone,

 

I have created a report using power bi desktop (Vesrion January 2021). In order to get the data for this report, I connect to a web API using the provided API key in the header part of the request:

 

PBIDesktopWEbRequest.jpg

 

This part works fine and I get the necessary data to work on the Power BI desktop.

 

 

When I publish the created report to a Power BI Report Server, as you can see in the following image, there is no way to add the header data which in this case is mandatory to authenticate:

 

 

PBIReportServerWebRequest.jpg

 

The Authentication part in the Credential section in the above image does not support adding headers data and only accepts Anonymous, Basic, and Windows authentication which are not applicable here (The test fails). 

 

As the data in my report changes regularly and I need to schedule an automatic refresh, the Report Server has to connect to the Web API at the scheduled times in order to get the latest version of the data.

 

I would appreciate it if you could help me to solve the encountered problem.

 

Regards

 

 

1 ACCEPTED SOLUTION

This part of your error message 

The remote name could not be resolved

sounds like there is a firewall or proxy or something in your network configuration blocking your server from accessing the remote api source. Or the service account that is running your report server instance does not have permission to access external sites. I suggest you talk to your IT team about this.

View solution in original post

4 REPLIES 4
d_gosbell
Super User
Super User

This should work if you leave the authentication type as anonymous. The Test button will report an error as it does not know about the apikey header embedded in your M code, it only knows about the url endpoint. But the refresh should still work fine.

I am experincing the same issue as OP. When I try to refresh through Report Server, I get a "Login failed for data source" error. I have set the authentication type as anonymous. Refreshing through PowerBI desktop works fine.

 

Error details:

Data source error: Login failed for data source ‘API URL HERE’.

SessionID: ID HERE
[0] -1055784932: DataSource.Error: The remote name could not be resolved: 'api.smartrecruiters.com'. (API URL HERE). The exception was raised by the IDbCommand interface.

 Any ideas? Also would like to hear from OP if they have experienced a similar error as me.

This part of your error message 

The remote name could not be resolved

sounds like there is a firewall or proxy or something in your network configuration blocking your server from accessing the remote api source. Or the service account that is running your report server instance does not have permission to access external sites. I suggest you talk to your IT team about this.

I think you're right. Talking to IT, it sounds like outside communication is not allowed for our report server. Thanks!

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.