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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Help on Power BI Service Refresh of APIs

Hi,

I have tried many methods to get my API to refresh in the service to no avail.

I keep getting this error message which, when I search for, I can't find anywhere.
A web API key credential is required when a web API key name is provided.

No matter what credntials I input, nothing works. Should I need to do this in the Service?

If I rmeove the ApiKeyName from my 'options' in the web.content() I get the error: 

A web API key can only be specified when a web API key name is provided.

Can anyone make any suggestions or work arounds? In particular ott he first error.

Thanks

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

According to the error message and M syntax, it seems like you directly input API key value into the data connector.

 

 

Please try the highlight lines:

https://dev.applicationinsights.io/documentation/Using-the-API/Power-BI

 

Eyelyn9_0-1642652957845.png

 

Here are similar threads that you could kindly refer to:

https://community.powerbi.com/t5/Power-Query/Set-API-Key-from-Cell-Value/m-p/1127837

https://community.powerbi.com/t5/Desktop/A-web-API-key-can-only-be-specified-when-a-web-API-key-name-is/m-p/1995048

https://community.powerbi.com/t5/Service/API-Call-Credentials-Invalid/m-p/1262662

 

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

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

 

Any updates?

 

Best Regards,
Eyelyn Qin

Anonymous
Not applicable

Hi @Anonymous ,

 

According to the error message and M syntax, it seems like you directly input API key value into the data connector.

 

 

Please try the highlight lines:

https://dev.applicationinsights.io/documentation/Using-the-API/Power-BI

 

Eyelyn9_0-1642652957845.png

 

Here are similar threads that you could kindly refer to:

https://community.powerbi.com/t5/Power-Query/Set-API-Key-from-Cell-Value/m-p/1127837

https://community.powerbi.com/t5/Desktop/A-web-API-key-can-only-be-specified-when-a-web-API-key-name-is/m-p/1995048

https://community.powerbi.com/t5/Service/API-Call-Credentials-Invalid/m-p/1262662

 

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

mahoneypat
Microsoft Employee
Microsoft Employee

Since you have a key, are you using Anonymous for the connection type? Please share your M code (remove/modify any key values).

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Anonymous
Not applicable

Hi,

 

Here:
Json.Document(Web.Contents(
"https://azapp-orca-ini-prod-func-rest.azurewebsites.net",
[RelativePath="/api/rest/v1/layers",
ApiKeyName = "code",
Query =
[ code = "<key>"]
]
))

 

This works in the PQE and I can access and transform the data. So, I know the key works.

 

Cheers,

Paul

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors