Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I'm using Web.Contents to call an API using and API Key as a url parm. When I published to the Power BI Service the refresh was failing with error "Query contains unsupported function. Function name: Web.Contents". After researching, I found numerous posts about this and how you must use the root URL with RelativePath to resolve. When I changed that in Desktop, it trys to authenticate against the root url, and when selecting anonymous it fails. The root URL for this API redirects to a sign-in page. I tried using Basic Auth and valid creds and it failed also. It seems that for some APIs the solution to use root URL and RelativePath with WebContents does not work.
The problem doesn't seem to lie with WebContents but with Power BI Service not supporting refresh using a full path (with query parms) with WebContents. Is that a correct statement?
I have experienced the same, where I had to use the base url as the first parameter to webcontents, then a combination of relative path and the query options
There have been other articles written on how to get around the power bi service trying to authenticate against the base url for anonymous that I have used successfully, but I wasn't using an api key
How are you passing your api key? Is their a specific header you are using or the canned one in webcontents?
Yeah, no header; it's passed in the query string. Authentication occurs in Desktop too, not just Power BI Service. The reason why I stated that it's a Power BI Service issue is that when using the full url with api key parameter in Web.Contents, no RelativePath etc. it works in Desktop.
My experience, when working with web service apis, is what works in the desktop, doesn't always work in the service
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.