Hi everyone,
I'm working on a Power BI report that pulls data from a CSV file hosted on SharePoint. The file is accessed using the Web.Contents() method in Power Query.
The report is published using “Publish to Web”, and the dashboard is embedded on a public-facing website. It has been working fine until recently — visuals still load, but now the dataset refresh in Power BI Service fails with the following error:
Failed to update data source credentials: The credentials provided for the Web source are invalid.
(Source at https://.../_api/contextinfo)
No other changes have been made, except that the file was recently moved to a different folder within SharePoint (same site). The CSV is still stored inside a private SharePoint document library and is not publicly shared.
I understand that Web.Contents() works only if the data source is publicly accessible.
My questions are:
- Why was the dataset able to refresh in Power BI Service before, even though the file was private?
- Is it possible that it was working off cached credentials or because the file was somehow publicly accessible before?
- What are some best practices to make this scenario work — where the data needs to stay private, but the dashboard must remain publicly accessible via "Publish to Web"?
Thanks in advance for your guidance!