PowerBI Service 通过数据网关从 REST API 读取数据。

huangapple go评论92阅读模式
英文:

PowerBI Service reading from REST API through Data Gateway

问题

我配置了基本身份验证的REST API服务器。我在PowerBI Desktop中配置了一个Power BI报表,以从这个REST API读取数据。我在Power BI中设置了数据源设置为匿名,然后通过Web内容标头传递基本身份验证密钥。

PowerBI Service 通过数据网关从 REST API 读取数据。

这运行得很好。然后,我将PowerBI报告发布到我的PowerBi Service工作区,以便与其他用户共享此报告并安排数据集刷新。我在具有对PowerBI Service和REST API访问权限的虚拟机上安装了本地数据网关。我假设凭据应与PowerBI Desktop中的数据源设置相同。由于我在PBI桌面中使用匿名,因此我在PBI服务中也使用相同的身份验证Web内容标头,并使用基本身份验证。然而,我遇到了以下错误:

无法更新数据源凭据:为Web源提供的凭据无效。 (源位于 https://**********/piwebapi。)

PowerBI Service 通过数据网关从 REST API 读取数据。

你有类似的经验吗?谢谢!

我还尝试在PBI Service中配置基本身份验证,它们被接受了。但是,当我尝试刷新数据集时,我收到以下错误:“仅在匿名连接时才支持带有Content选项的Web.Contents。”

英文:

I have a REST API Server configured for Basic authentication. I have configured a Power BI report in PowerBI Desktop to read from this REST API. I've setup the Data Source Setting in Power BI as anonymous and then pass the Basic authentication key through the web contents headers.

PowerBI Service 通过数据网关从 REST API 读取数据。

This works fine. Then I publish the PowerBI report to My Workspace at PowerBi Service to be able to share this report with other users and schedule the dataset refresh. I've installed the on-prem data gateway in a VM that has both access to PowerBI Service and also access to the REST API. I assume that the credentials should be the same as in the Data Source Settings in PowerBI desktop. Since I use anonymous in PBI desktop then I use the same in the PBI service and use the authentication web contents headers for Basic authentication. However 'm getting the following error:

Failed to update data source credentials: The credentials provided for the Web source are invalid. (Source at https://**********/piwebapi.)

PowerBI Service 通过数据网关从 REST API 读取数据。

Have you experienced something similar? Thanks!

I tried also configuring Basic at PBI Service, and they are accepted. However when I try to refresh the dataset I get the following error: "Web.Contents with the Content option is only supported when connecting anonymously."

答案1

得分: 2

"POST请求只能匿名进行。"

https://learn.microsoft.com/en-us/powerquery-m/web-contents

而且,Power BI不允许您在通过服务刷新时将纯文本凭据粘贴到查询中。也就是说,您无法通过编写自己的身份验证标头来进行基本身份验证调用。

因此,在使用非匿名请求时,使用Web.Contents连接器的唯一选项是将请求完全传递到查询字符串或HTTP标头中。

英文:

"POST requests may only be made anonymously."

https://learn.microsoft.com/en-us/powerquery-m/web-contents

And Power BI will not allow you to paste plain-text credentials into your query when refreshing through the service. IE you can't make a BASIC auth call with credentials by writing your own Authentication header.

So the only option to use the Web.Contents connector is to pass the request entirely in the query string or HTTP headers when using a non-Anonymous request.

huangapple
  • 本文由 发表于 2023年2月23日 21:39:53
  • 转载请务必保留本文链接:https://go.coder-hub.com/75545609.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定