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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Burma
Helper I
Helper I

Scheduled refresh with anonymous web service fails

Hi,

 

I've come across an issue with Power BI Service being unable to refresh the data from an anonymous Web Service with authentication token. Looks like while checking the connectivity (before doing the actual refresh) of Web.Contents, Power BI Service omits all the query parameters and headers. As a result, it does not get any reply from the server or gets 400 Bad Request (since all the required parameters were removed).

 

Needless to say, that refreshing the data with all the query parameters and headers works just fine in the Desktop. Also, if I remove the authentication token requirement from the Web Service and just return HTTP 200, everything works fine. I can later add the authentication token requirement back and Power BI service will be refreshing fine, until I republish the report.

 

Is there any way to force Power BI not to test data source connectivity (or at least don't drop headers and parameters when doing so)? 

 

Thanks

1 ACCEPTED SOLUTION
Burma
Helper I
Helper I

I found a solution here https://chris.koester.io/index.php/2017/03/28/call-an-azure-function-from-power-bi/

 

The trick is to fool Power BI and make it connect to the top level domain by placing the URL path into RelativePath parameter:

 

    // Submit JSON object to Azure Function using an HTTP POST
    StatusUpdate = Web.Contents(url,
     [
         Headers = [#"Content-Type" = "application/json"],
         Content = Text.ToBinary(jsonContent),
         RelativePath="/api/<function name>?code=<function code>"
     ]

View solution in original post

1 REPLY 1
Burma
Helper I
Helper I

I found a solution here https://chris.koester.io/index.php/2017/03/28/call-an-azure-function-from-power-bi/

 

The trick is to fool Power BI and make it connect to the top level domain by placing the URL path into RelativePath parameter:

 

    // Submit JSON object to Azure Function using an HTTP POST
    StatusUpdate = Web.Contents(url,
     [
         Headers = [#"Content-Type" = "application/json"],
         Content = Text.ToBinary(jsonContent),
         RelativePath="/api/<function name>?code=<function code>"
     ]

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors