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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
walid140891
Helper III
Helper III

Web.Contents failed to get data through Azure Function http call!

Hello Power BI Pros,

We call an azure function url via Web.Contents() method as following:

let
    Source = (CustomerGuid as text) => let
       Source = Json.Document(
           Web.Contents(
               "http://powebidatarefresh.azurewebsites.net/api/PBIRefreshFunction/Run/",
               [RelativePath = CustomerGuid] 
               )
        ) in Source
in
    Source


It works fine, but with some certain datasets (usually larger ones), I could refresh and get all the data in the Power Query Editor (Transform data) but in the power bi desktop itself I get this error:

walid140891_0-1670499271370.png

 

The reason is not obvious specially that when we call the azure function with the same customer guid it works and returns the data correctly!

Thank you in advance for your help ❤️

2 REPLIES 2
Anonymous
Not applicable

Hi @walid140891 ,

Please refer to past solutions.

 

(502): Bad Gateway:

Solved: Connecting to Application Insights: Bad Gateway Er...

(500): Internal Server Error:

Solved: File too big to import from online source- (500): ...

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Hi @Anonymous ,

Thank you for your response, it's mentioned that 502 bad gateway issue is related to the fact that the query returns too much data, however we use power bi for showing incretemntally saved data, that means we need all the historical data and we cannot limit the refresh time frame!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors