Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
musa
Frequent Visitor

Power BI not saving basic authentication credentials during scheduling

Hi, 

 

I can refresh manually on desktop, but when scheduling a refresh on the cloud I keep getting this error:

'WebContents failed to get contents'

 

Checking the 'Data Source Credentials' shows that 'Anonymous' method is being saved, even though I have it set to 'basic' with username and password on the Desktop version. I can input my credentials by selecing 'Basic' (username and password), but the next time the job is scheduled to run and refresh the app doesn't save my credentials causing this error again.

 

Any help is much appreciated.

 2018-02-15_11-11-41.png2018-02-15_11-11-28.png

 

6 REPLIES 6
jackwaayer
Frequent Visitor

I think I was having the same issue you had here. My fix was very straight forward.

I went into Power BI desktop, editted the query for getting the data from the API to - Json.Document(Web.Contents("url"))

(No authorization headers included)

Set my credentials to Basic Auth and entered the credentials.

Saved and published the report up to the cloud.

 

When in the cloud version, I went to my dataset's settings and checked the "Data Source Credentials" to make sure everything was working.

Sure enough, I was faced with:

Your data source can't be refreshed because the credentials are invalid. Please update your credentials and try again.

BUT, there was a little spinning/loading thing next to the edit credentials link.

I decided to give it some time to see what would happen and boom!

Once it had loaded, the error went away and I could now set up my Scheduled Refresh.

 

Seems like the auth defaults to Anonymous until your basic auth has made the connection (seems to take a while the first time).

 

Not sure if this will help you but thought I'd post it anyway!

 

 

 

jackwaayer
Frequent Visitor

I think I was having the same issue you had here. My fix was very straight forward.

I went into Power BI desktop, editted the query for getting the data from the API to - Json.Document(Web.Contents("url"))

(No authorization headers included)

Set my credentials to Basic Auth and entered the credentials.

Saved and published the report up to the cloud.

 

When in the cloud version, I went to my dataset's settings and checked the "Data Source Credentials" to make sure everything was working.

Sure enough, I was faced with:

Your data source can't be refreshed because the credentials are invalid. Please update your credentials and try again.

BUT, there was a little spinning/loading thing next to the edit credentials link.

I decided to give it some time to see what would happen and boom!

Once it had loaded, the error went away and I could now set up my Scheduled Refresh.

 

Seems like the auth defaults to Anonymous until your basic auth has made the connection (seems to take a while the first time).

 

Not sure if this will help you but thought I'd post it anyway!

 

 

 

Anonymous
Not applicable

I think it's worth sharing that I just created a simple app to force updates using the PowerBI API as a workaround to this issue.  As a bonus it allows up to 8 updates per day for PowerBI Pro users (and 48 I believe for Enterprise-level subscriptions).

 

Details on the API and the specific refresh endpoint are here:

https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/refreshdataset

 

or for datasets in groups:

https://docs.microsoft.com/en-us/rest/api/power-bi/datasets/refreshdatasetingroup

Anonymous
Not applicable

I have this exact issue as well.

musa
Frequent Visitor

Hi, I am experiencing an issue where a report created on desktop works and refreshes but when published to the cloud I receive this error when trying to schedule:

 

Webcontents failed to get contents.

 

When I check the dialog box for credentials, 'Anonymous' is selected. I switch it to 'Basic' and include username and password but when I exit the window and check back it defaults to anonymous.

 

Any help is much appreciated. 

 

2018-02-15_11-11-41.png2018-02-15_11-11-28.png

HI @musa,

 

>>When I check the dialog box for credentials, 'Anonymous' is selected. I switch it to 'Basic' and include username and password but when I exit the window and check back it defaults to anonymous.

Current power bi service authentication mode will located at anonymous even if you succeed sign in with other credential.

 

According to your erreor message, it seems not related to credential, please refer to below link to know more about this.

400 Bad Request Error: What It Is and How to Fix It

 

In addition, did you use custom functions or query parameters in power query? If this is a case ,current query parameter and custom function not support on power bi service.

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.