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

PowerBI refresh data from AWS API Gateway Rest API

On my local machine, I have connected a PowerBI report to a set of REST APIs that are from AWS API Gateway that require an api-key in the header. The report loads and can refresh the data successfully when locally. The code for connecting looks like:

 

Source = Json.Document(Web.Contents("https://" & #"API URL",
[RelativePath = "prod/productionData", Headers=[#"x-api-key"=#"apiKey"],
Query = [#"site" = #"SiteID", #"timerange" = #"LongTimeRange"]]))

However, when I upload the file onto my company's PowerBI workspace, it is unable to refresh because "Failed to update data source credentials: The credentials provided for the Web source are invalid. "

 

The API can only be accessed when the apiKey is passed through the header. How can I get PowerBI to play nicely with this setup from the AWS side?

1 REPLY 1
TeigeGao
Solution Sage
Solution Sage

Hi @Anonymous ,

Based on my searching, some API cannot work well with web.content in PowerBI Service, for more information, please refer to this idea: https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/10927416-web-contents-should-support-scheduled-refresh-ev.

As a workaround, we can use the Python script to get the data from the API, then convert it to dataframe data type, PowerBI can recognize the data type.

Best Regards,

Teige

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