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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
BIAnalyst907
New Member

PBI Service Refresh Error -A web API key credential is required when a web API key name is provided

I have been trying to set up a report to auto refresh, pulling data from a WebAPI data source. I'm getting the following error: 

 

"A web API key credential is required when a web API key name is provided.. The exception was raised by the IDataReader interface. Please review the error message and provider documentation for further information and corrective action." 

 

 

 

I've tried hardcoding the key into the query to no avail. 

 

 

Has anyone encountered this issue? Any known workarounds? 

 

 

Thanks

5 REPLIES 5
bragarods
New Member

I'm facing the exactly same problem. Following here to see if there's a solution for that.

otravers
Community Champion
Community Champion

How do you authenticate against the API? Does it refresh in Power BI Desktop? This thread (and the links within it) might help you:

https://community.powerbi.com/t5/Power-Query/Help-on-Power-BI-Service-Refresh-of-APIs/td-p/2287076

------------------------------------------------
1. How to get your question answered quickly - good questions get good answers!
2. Learning how to fish > being spoon-fed without active thinking.
3. Please accept as a solution posts that resolve your questions.
------------------------------------------------
BI Blog: Datamarts | RLS/OLS | Dev Tools | Languages | Aggregations | XMLA/APIs | Field Parameters | Custom Visuals

Just an API key is being used for authentication.

 

Refresh works in Power BI Desktop with no issues. We've tried configuring the report in a variety of ways that work perfectly on the desktop version then hits an issue when trying to set up the auto refresh.

 

 

 

 

Hi @BIAnalyst907 ,

 

Have you gone through the details of what is mentioned in this error message and the relevant documentation provided?

vmengzhumsft_0-1663753888897.png

There may be a solution to this problem. You can also show me the details so that I can better understand your error.

 

Best regards,

Community Support Team Selina zhu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Isn't it obvious what he means? In Power BI Desktop you get 4 authentication methods, one of them is WebAPI. Desktop asks for the key and refreshes correctly.
But when you deploy the same report to Power BI Service and are asked to enter credentials when setting up scheduled refresh, there is no WebAPI on the list. You get "Basic", "Anonymous" and "OAuth". 
Since you are asked to enter credentials when setting up refresh, the question is: what to enter? Which authentication method to choose since WebAPI is missing?
Hardcoding an API key in M query (pbix) - even if it worked - defeats the [security] purpose really. 

Helpful resources

Announcements
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!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.