Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
I'm connecting to a REST API to bring several tables into a Power BI file. I can connect to the API and retrieve the data without any issues using 'Get Data > Other > Web' from the main toolbar, and then entering a URL in the format:
https://api01.naturalhr.net/2.0/timeoff/key/(security key here)/format/xml
The data usually comes back quite quickly - within about 10-20 seconds.
My issue is that when I try to refresh the same data it usually times out after 5-ish minutes. To refresh I go to 'Transform Data (I think this was 'Edit Queries' in earlier versions) > Select the query I'm interested in (in this case 'timeoff') > Select the 'Refresh Preview' button on the main menu. Note that I do have some transformations to the original data, but even when I remove all of these I am still seeing the time-out.
I'm spent some time trying to troubleshoot this with some help from some guys over at StackOverflow, and what I've found is that (using the new-ish Power BI diagnostic tools) while the Resource column displays the original URL, the Data Source Query column appends the text 'HTTP/1.1' to the original URL (i.e. https://api01.naturalhr.net/2.0/timeoff/key/(security key here)/format/xml HTTP/1.1 ). If I try to establish a new connection with the 'HTTP/1.1' text added to the URL string, the query times out. Screenshot below.
Can anyone tell me why the extra text is added by Power BI, why this might be preventing the data being returned, and how I can work around this? Thanks.
Solved! Go to Solution.
Hi @gav12345 ,
You could see the diagnotics schema about "Data Source Query" here.
The Data Source Query column allows you to see the query or HTTP request/response sent against the back-end data source. As you author your Query in the Editor, many Data Source Queries will be emitted. Some of these are the actual final Data Source Query to render the preview, but others may be for Data Profiling, Filter dropdowns, information on joins, retrieving metadata for schemas, and any number of other small queries.
I tested with a simple URL, it returned "GET" and "HTTP/1.1" too.
So you could add a "timeout" parameter in Web.Contents() function. Here is a similar case for your reference.
https://community.powerbi.com/t5/Desktop/Query-Timeout-on-update/td-p/53459
Hi @gav12345 ,
You could see the diagnotics schema about "Data Source Query" here.
The Data Source Query column allows you to see the query or HTTP request/response sent against the back-end data source. As you author your Query in the Editor, many Data Source Queries will be emitted. Some of these are the actual final Data Source Query to render the preview, but others may be for Data Profiling, Filter dropdowns, information on joins, retrieving metadata for schemas, and any number of other small queries.
I tested with a simple URL, it returned "GET" and "HTTP/1.1" too.
So you could add a "timeout" parameter in Web.Contents() function. Here is a similar case for your reference.
https://community.powerbi.com/t5/Desktop/Query-Timeout-on-update/td-p/53459
I'm having one or two issues replying to this. In summary, adding the timeout seems to have resolved this for now - many thanks for your help.