Forum Discussion
Not possible to refresh a web source in Report Server
- 3 years ago
Hi
The suggested solution helped. It was necessary to only have the main Url as the first parameter and then I added Relative Path and Headers as part of second parameter. The Web call now showed up as a Data Source and it was possible to publish it to Report Server.In PBIRS it was not possible to test connection, but I ignored that, since it was possible to define a schedule for the report.
Now, when refreshing the report I got an error where PBI claims that it is not possible to refresh due to dependent data. Holy Moly!!!.
(a simplified report was possible to refresh in PBIRS)Noticed that ithe same has happend for others.
So, original case closed and I will have to look into the refresh issue instead.
The most likely cause for your issues is the fact that you have a concatenation expression as the source for the Web.Contents call so the server cannot figure out what data source it needs to authenticate for. Can you try using the optional relative path or query parameters as suggested here Chris Webb's BI Blog: Using The RelativePath And Query Options With Web.Contents() In Power Query And Power BI M Code (crossjoin.co.uk) instead of doing the concatenation?
There are a number of operations which you can do in Desktop which get blocked in shared environments (like Report Server) due to potential security issues. In this dynamic expression example if you had the url set as a parameter or read from a table it would be potentially possible to change the destination address after credentials had been stored. This could potentially allow you to hijack these credentials for some other purpose which is why the server does not allow this.
Hi! I have the same problem. I've searched through this article and much more, but I can't find why it doesn't work for me. Maybe you can point out the error?
let
url = "http://host:port/resto/api/",
headers = [#"Content-Type"="application/json"],
body = Text.ToBinary("{<query>}"),
token = Text.FromBinary(Web.Contents(url & "auth?login=" & "login" & "&pass=" & "pass")),//here I get a new token every time I update
Source = Json.Document(
Web.Contents(url & "v2/reports/olap?key="& token & "&reportType=SALES",
[Query =[token = Text.FromBinary(Web.Contents(url & "auth?login=" & "login" & "&pass=" & "pass"))] ,
Headers= headers,
Content=body])),
#"Converted to Table" = Record.ToTable(Source)
in
#"Converted to Table"
- timabard3 years agoFrequent Visitor
Rest was good and I was able to find a solution for myself.
let
Source = Json.Document(
Web.Contents("http://host:port/",
[RelativePath = "resto/api/v2/reports/olap?key="&
(Text.FromBinary(Web.Contents("http://host:port/",
[RelativePath = "resto/api/auth?login=" & "login" & "&pass=" & "pass"]))) & "&reportType=SALES",
Headers= [#"Content-Type"="application/json",Content=body]])),
#"Converted to Table" = Record.ToTable(Source)in
#"Converted to Table"