Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.