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.
Hi all,
I am working with a REST API that sends in POST. I am using the code below, and I am able to refresh in desktop client after about 20 minutes. However, when I perform schedule refresh I get the following error: "The underlying connection was closed: The connection was closed unexpectedly". It seems like the cloud client is "giving up too easily". I am using a datagateway.
let
Source = let
Source = let
url = "https://url.com",
body = "{""id"": ""XXX"" }",
Source = Json.Document(Web.Contents(url, [Timeout= #duration(0, 1, 0, 0),
Headers = [#"Authorization"="Basic XXXX", #"Content-Type"="application/json", #"Connection" = "keep-alive"],
Content = Text.ToBinary(body)
]))
The API has a lag before data is sent back for large queries. I am wondering if there is a way to keep the connection open in my mQuery code. I already tried adjusting the timeout with no luck.
@shuhn1229 , refer if this can help
https://community.powerbi.com/t5/Power-Query/Getting-Data-From-POST-API-with-JSON-Body/td-p/1847021
I resolved this by pre-caching the query. It has something to do with the fact that if the cloud refresh isn't recieving a response, it will kill the connection after about 6 minutes (time out does not solve this). Meanwhile, if the query is preloaded, even if its large, cloud refresh works. I took a look at those sources, I didn't see anything applicable but I do appreicate your help. I'm leaving this open in case anyone ever solves it.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
100 | |
80 | |
63 | |
58 |
User | Count |
---|---|
148 | |
111 | |
94 | |
84 | |
67 |