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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors
Top Kudoed Authors