0
votes

I have an issue with the scheduled refresh function in Power BI. I have published a PBIX file to the web environment of Power BI. As with other PBIX files, I set the scheduled refresh via the on-premises gateway. My PBIX file has data from several sources (MySQL, OData, other Web connectors). 

Setting up and connecting the MySQL source to scheduled refresh (via the gateway) works fine. However, when trying to connect the OData source to the gateway, this fails. The message shows that credentials are invalid, "AccessUnauthorized". However, via PBI Desktop there is no need for me to use credentials (as access is via Anonymous, with an API key "Bearer .........").  Error message in Power BI web

The following settings are used (in the gateway setup tab): 

Type of source:  OData

URLhttps://tcodata.azurewebsites.net/estimates

Authentication method: Anonymous

Privacy-settings: None

The following code is used in 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)

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!

1

1 Answers

0
votes

The question was answered on the PowerBI forum:

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".

Source