简体   繁体   English

Power BI - 计划刷新 - OData 源 - 匿名

[英]Power BI - scheduled refresh - OData source - anonymous

I have an issue with the scheduled refresh function in Power BI.我对 Power BI 中的计划刷新功能有疑问。 I have published a PBIX file to the web environment of Power BI.我已将 PBIX 文件发布到 Power BI 的 Web 环境。 As with other PBIX files, I set the scheduled refresh via the on-premises gateway.与其他 PBIX 文件一样,我通过本地网关设置计划刷新。 My PBIX file has data from several sources (MySQL, OData, other Web connectors).我的 PBIX 文件包含来自多个来源(MySQL、OData、其他 Web 连接器)的数据。

Setting up and connecting the MySQL source to scheduled refresh (via the gateway) works fine.设置 MySQL 源并将其连接到计划刷新(通过网关)工作正常。 However, when trying to connect the OData source to the gateway, this fails.但是,当尝试将 OData 源连接到网关时,这会失败。 The message shows that credentials are invalid, "AccessUnauthorized".该消息显示凭据无效,“AccessUnauthorized”。 However, via PBI Desktop there is no need for me to use credentials (as access is via Anonymous, with an API key "Bearer.........").但是,通过 PBI Desktop,我不需要使用凭据(因为访问是通过匿名的,使用 API 密钥“Bearer.........”)。 Power BI Web 中的错误消息

The following settings are used (in the gateway setup tab):使用以下设置(在网关设置选项卡中):

Type of source : OData来源类型:OData

URL : https://tcodata.azurewebsites.net/estimates网址https ://tcodata.azurewebsites.net/estimates

Authentication method : Anonymous身份验证方法:匿名

Privacy-settings : None隐私设置:无

The following code is used in PBI Desktop: PBI Desktop 中使用了以下代码:

let
    apiUrl = "https://tcodata.azurewebsites.net/estimates",
    Source = OData.Feed(apiUrl , null, [Implementation="2.0", Headers = #"Authorization"=Text.From(ApiKey)]])
in
    Source

The API key refers to ApiKey = Bearer........(key here) API key指的是ApiKey = Bearer........(key here)

No real authentication is needed, because it is accessed as Anonymous.不需要真正的身份验证,因为它是以匿名方式访问的。 However, when setting the scheduled refresh, this does not work (as credentials are said to be invalid).但是,在设置计划刷新时,这不起作用(因为凭证被认为是无效的)。

Help is much appreciated, thanks!非常感谢帮助,谢谢!

The question was answered on the PowerBI forum:在 PowerBI 论坛上回答了这个问题:

When refreshing odata source in Power BI service, with the power query code as yours, you don't need to add it under the on-premise gateway, just go to "data setting"->"schedule refresh"->edit credential for that odata source, select "anonymous".在Power BI服务中刷新odata源时,power query code为自己的,不需要在on-premise gateway下添加,只需进入“数据设置”->“计划刷新”->编辑凭据即可该odata源,选择“匿名”。

Source 资源

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM