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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.