cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Permissions problem for dynamically named web data source

I have a PBI report that accesses delimited text files from a web server. Every day a new text file is added to the directory and the file name contains string representing the date. I have created a function to access these files. I have to first construct the name(s) of the file(s) I want. So if I want to get a file generated yesterday, I will calculate the proper date string based on DateTime.LocalNow() and adjust for -1 day. I then use Web.Contents() with my properly constructed file name. This works when I am running the query from Power BI Desktop for Report Server. However when I save the report to the Report Server, and try to set up automatic refresh it fails. The dyanamic data source is not "seen" as a source for which I can enter credentials. Apparently the server expects to have crendentials set for every individual file, but the file names are not constructed until run time. Due to the hand-edited functions and queries, these sources are "invisible" at the time of entering credentials.

 

I would like to be able to enter credentials for the web folder that the files are in, and have it apply those permissions to any file in the folder. I can't see a way to do this.

 

Why does the refresh work from PBI Desktop but not from the report running on the report server? And does anyone have a suggestion of how to solve this problem? Thanks for any clues you can provide!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Permissions problem for dynamically named web data source

Hi @gitouttatown 

 

You can probably resolve the issue with the scheduled refresh by the method on this blog:

https://blog.crossjoin.co.uk/2016/08/23/web-contents-m-functions-and-dataset-refresh-errors-in-power... 

 

Here's official trouble shotting document could also provide some hints:

https://docs.microsoft.com/en-us/power-bi/report-server/scheduled-refresh-troubleshoot 

https://docs.microsoft.com/en-us/power-bi/report-server/scheduled-refresh 

 

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Permissions problem for dynamically named web data source

Hi @gitouttatown 

 

You can probably resolve the issue with the scheduled refresh by the method on this blog:

https://blog.crossjoin.co.uk/2016/08/23/web-contents-m-functions-and-dataset-refresh-errors-in-power... 

 

Here's official trouble shotting document could also provide some hints:

https://docs.microsoft.com/en-us/power-bi/report-server/scheduled-refresh-troubleshoot 

https://docs.microsoft.com/en-us/power-bi/report-server/scheduled-refresh 

 

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

View solution in original post

Highlighted
Frequent Visitor

Re: Permissions problem for dynamically named web data source

Hey copious "thanks" to @v-diye-msft v-diye-msft! The post from Chris Webb's blog on the RelativePath argument to Web.Contents, held the key. Once I started using that, I was able to provide credentials to the 'base' URL and no longer got errors. Now my report will auto refresh using Report Server. 

Helpful resources

Announcements
Super Users of the Quarter - Q2 2020

Super Users of the Quarter - Q2 2020

Who are our Super User Superstars? Who made it to the top of the leaderboards? Get the answers!

June 2020 Community Highlights

June 2020 Community Highlights

Featured community members, changes to the Community, and more! Read up on recent Power BI community news.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Power Platform 2020 release wave 2 plan

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors