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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
v-eqin-msft
Community Support
Community Support

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
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

 

Any updates?

 

Best Regards,
Eyelyn Qin

v-eqin-msft
Community Support
Community Support

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
Employee
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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors