Forum Discussion

mlc-bi's avatar
mlc-bi
Regular Visitor
6 years ago
Solved

Scheduled refresh OData source - invalid credentials with anonymous verification method

Hi there,

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

The following settings are used: 

 

Type of source:  OData

URL: https://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

 

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 Reply