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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
snig2018narayan
Frequent Visitor

Dataset Refresh Fails in Power BI Service with Web.Contents and SharePoint File

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:

  1. Why was the dataset able to refresh in Power BI Service before, even though the file was private?
  2. Is it possible that it was working off cached credentials or because the file was somehow publicly accessible before?
  3. 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!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @snig2018narayan ,
Thank you for reaching out to us Microsoft Fabric Community Forum!

1.Why was the dataset able to refresh in Power BI Service before, even though the file was private?

It’s likely that Power BI was using cached credentials from when the file was accessible. Another possibility is that the old SharePoint folder had permissions, which let the refresh go through without issues. But now that the file was moved, those permissions may have changed, causing Power BI to run into the error.

 

2.Is it possible that it was working off cached credentials or because the file was somehow publicly accessible before?
 It’s worth checking if the original file or folder was set to “Anyone with the link,” which could’ve allowed it to be accessed without a login. You can verify this by reviewing the sharing settings for the file in SharePoint.

3. 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"?

Here’s a list of steps you mayfollow :

  • Update credentials in Power BI Service with an account that can access the new folder.
  • Swap Web.Contents() for the SharePoint Folder connector, it’s made for private files.
  • Confirm the file’s permissions in SharePoint.
  • Since it’s a public “Publish to Web” report, ensure the CSV has no sensitive info. For more details refer https://learn.microsoft.com/en-us/power-bi/collaborate-share/service-publish-to-web 

    Publish to Web only works with publicly accessible data. If the file needs to stay private, it might be worth considering secure embedding or other sharing options.

     

    If this answer helped you to resolve your query,consider accepting it as solution.

    Regards,
    Pallavi.

 

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi  @snig2018narayan ,
Thank you for reaching out to us Microsoft Fabric Community Forum!

1.Why was the dataset able to refresh in Power BI Service before, even though the file was private?

It’s likely that Power BI was using cached credentials from when the file was accessible. Another possibility is that the old SharePoint folder had permissions, which let the refresh go through without issues. But now that the file was moved, those permissions may have changed, causing Power BI to run into the error.

 

2.Is it possible that it was working off cached credentials or because the file was somehow publicly accessible before?
 It’s worth checking if the original file or folder was set to “Anyone with the link,” which could’ve allowed it to be accessed without a login. You can verify this by reviewing the sharing settings for the file in SharePoint.

3. 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"?

Here’s a list of steps you mayfollow :

  • Update credentials in Power BI Service with an account that can access the new folder.
  • Swap Web.Contents() for the SharePoint Folder connector, it’s made for private files.
  • Confirm the file’s permissions in SharePoint.
  • Since it’s a public “Publish to Web” report, ensure the CSV has no sensitive info. For more details refer https://learn.microsoft.com/en-us/power-bi/collaborate-share/service-publish-to-web 

    Publish to Web only works with publicly accessible data. If the file needs to stay private, it might be worth considering secure embedding or other sharing options.

     

    If this answer helped you to resolve your query,consider accepting it as solution.

    Regards,
    Pallavi.

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors