I'm doing a weekly update to a rather large amount of datasets and have been encountering the following error:
Expression.Error: Access to the resource is forbidden
If I use an older version of Power BI, I do not have the same issue. This worked fine a week ago (and has for several months). No organizational changes as far as I'm aware, as I'm able to obtain those web documents from an older version of Power BI (2.63.3272). The version on which I'm getting the error is 2.65.5313.
Edit: Additional information... all the data resides in Excel files out on a sharepoint location. We use organizational sign-on to get access to the files. It is working and I can access it manually as well as through the older Power BI. I'm not getting the opportunity to sign into the organizational account for the files with this error. It just flatly denies me access.
Any assistance on this?
I ran into a very similar issue yesterday when I updated to the December release of the Desktop
The report where I encountered this issues pulls data from a RESTful web service API using anonymous authentication
I could not refresh the data in the desktop because I couldn't get past the "access to the resource is forbidden"
I reverted back to the November release,Version: 2.64.5285.741 64-bit (November 2018), of the desktop and was able to refresh just fine
I am also now having issues with my report the uses the same RESTful web service API data sources not being able to refresh in the service, where they were able to just fine last week, up to this past Sunday, but that is another story
Good luck and looking forward to seeing additional comments on your issue
Thanks for confirming it's not just me. I just found a copy of the November release and I've learned two things from this:
I tried re-signing back into the dataset, but that didn't help. I was also planning on setting my reports up for service refreshes, but since all my datasets are accessible through the web service API, that's going on hold.
Yes, I do the same, I keep at least the past 3 months of the desktop installs
To clarify, not all of my reports that use web servce calls fail to refresh in the service
It seems to be one, though it refreshed just fine until this past weekend
It is not much different than the other reports that work
The issue I am seeing in the service is I keep getting the error "The credentials provided for the Web source are invalid"
I am facing exactly the same issue as you, it is driving me CRAZY!
I have spent several days troubleshooting now.
This error seems random or at least affect only a portion of my data sources.
Here is how I tested:
-Created 3 test cases; Workspace A, Workspace B and Workspace C, each with an individual Access Token.
-Verified that access credentials to web content are solid for each Workspace and Access Token combination (via Azure and alternative method)
-Created a simple pbix file in PBI Desktop to pull one dataset from a URL that includes Workspace and Access Token
-Setup parameters in query editor for Workspace and Access Token
-Verified that all 3 cases refresh perfectly in PBI Desktop, even swapped between the 3 Workspace and Access Token combinations several times, no problems at all.
-Published pbix to PBI Service
This is where things start to get crazy!
-I edited the parameters for Workspace and Access Token
-For cases A and C there are no issues, PBI Service accepts the credentials
-For case B I face the issue, credentials are supposedly invalid. This is the error I get: Failed to update data source credentials: The credentials provided for the Web source are invalid.
-I swapped parameters several times between cases A, B and C, and the result is consistent: A and C succeeds, B fails.
And here is the REALLY crazy part – when I do a manual refresh the dataset with B’s Workspace and Access Token parameters IT WORKS!
So, what is going on?
My only theory is that PBI Service has an issue in “Dataset -> Settings -> Data Source Credentials” with the function that check for data access. As a result, it fails when checking this particular token of case B. As I said the token is valid, and PBI Service can refresh the dataset manually.
My last idea to solve this, is to create a new access token and hope this is simply a glitch in PBI Service.
What are your thoughts?
I'm experiencing the same problem. REST API connection works fine in Version: 2.64.5285.741 64-bit (November 2018) but fails with Expression.Error: Access to the resource is forbidden. with any newer version. I've tried clearing and resetting permissions to all data sources in my file, and setting the .pbix file option to ignore privacy levels but nothing works.
I want to use new features from recent desktop releases for my models, but I'm blocked because of these issues and can't improve any of my production models. PBI team are you aware of this issue? Please resolve the problem and support REST API based connections, I have several efforts that take advantage of them.
We did some mad troubleshooting to solve this one, but we finally managed to solve it, but only in an ugly way.
It seems the static credential evaluation under dataset settings in PowerBi Service kept hanging on to some old/obsolete credentials.
In the beginning we were not able to detect this as the error message, did not reveal the full URL in the textbox or the tooltip. Support was not able to help, so what do you do? F12 Chrome inspector, and sure enough it revealed the full info including token etc. There we saw that the access token was some old obsolete token, that is why, somehow, not matter what we did, it kept returning Access to ressource is forbidden.
So how did we solve this?
We tried deleting the file and publishing a new one, but nothing helped.
Apparently this seems to be cached in some way.
In the end we setup a proxy to always return success for the static data source credential evaluation.
Then we rely on the access token passed in the URL for the actual authentication.
I know it is not pretty, but it worked.
I am curious to know if your root cause is the same, please let me know.
Concerning header based authentication I too attempted to build my own proxy to handle authentication but unfortunately my issues persisted. I'm definitely unsuccessful in refreshing data sources that use http header based authentication in the service. The file refreshes fine in the desktop but as soon as it's published to the service scheduled refresh is disabled with one of 2 messages:
I reached out to MSFT product support and they confirmed this is not supported, it does not work in Dataflows either.
Concerning the Exception of type 'Microsoft.Mashup.Engine.Interface.ResourceAccessForbiddenException' was thrown. error, I am still waiting for MSFT product support to get back to me. I can reproduce the problem with the December 2018 desktop release but the November 2018 release always works. I gave up on this particular source and found a different API endpoint that worked.
Sorry to hear that it did not work for you. With our proxy we set it up to always return 200, to make sure the static crendetial check in PowerBi succeeds, did you do that too?
The problem is that static credential check in dataset settings. It some how caches old url and parameter values. And there is not apparent way to clear that cache, not even deleting the file and publishing it again.
That is why your proxy must always return 200, also if you provide invalid credentials. That will trick the static credential check.
Then of course the URL + parameters should enforce correct auth.
Let me know if it works.