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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
BjoernLueers
Advocate II
Advocate II

Authentication Method "Web API" not supported in Power BI Service

Currently the authentication method "API Token" does not seem to be supported in the Power BI Service. 

I used the ApiKeyName attribute from the Web.Contents method to declare the name of the header attribute. This worked perfectly in Power BI Desktop, i was asked to authenticate, clicked Web API and entered the API token. 

In the Power BI Service however there is no Web API Authentication method and I found no way to log in using the methods provided. 

Even worse is that i found no way at all to refresh the dataset in the service afterwards. Even hardcoding the API token into the the request URL did not work. The service would always ask for the API token:

"Failed to update data source credentials: A web API key credential is required when a web API key name is provided", even though I removed the ApiKeyName attribute and published the report with a different name in a different workspace. As if the Power BI service remembered that the source required an API token.

Only by using a different Power BI Service user I could finally resolve this. The message did not appear and I could authenticate anonymously.

5 REPLIES 5
BjoernLueers
Advocate II
Advocate II

No, but I did not try since 2020, so it is definitely worth checking if this is supported now.

v-diye-msft
Community Support
Community Support

Hi @BjoernLueers 

 

If my above post helps, could you please consider Accept it as the solution to help the other members find it more quickly. thanks!

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
v-diye-msft
Community Support
Community Support

Hi @BjoernLueers 

 

It sounds like you need to specify an API key name in the headers area of Web.Contents using the advanced editor.  See Chris Webb's post on this for a good example: https://blog.crossjoin.co.uk/2014/03/26/working-with-web-services-in-power-query/.  

 

Here's another post probably helpful for you:

https://community.powerbi.com/t5/Desktop/Get-data-from-web-error-A-web-API-key-can-only-be-specified...

 

If the issue still exist , please kindly raise it to support team: https://powerbi.microsoft.com/en-us/support/

Support Ticket.gif

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.

Both of those approaches appear to involve hard-coding secrets into the PBIX file, which is not good from a security perspective. Anyone who gets the PBIX gets my secret.

 

I would expect that the PBI Service would manage the API Keys with the same approach as with Basic Auth, where the secret is write-only (only the service can get at it).

 

Jason

hey did you got any idea how to not hardcode credentials and use powerbi auth only for POST API call??

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.