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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Web connection API Key

I have a web connection that I'm using for a report, for this connection I have a API Key that I'm using to authorise getting the data. 

This works fine in desktop but when I'm publishing I'm not able to authorise myself there. 

The PBI documentation says "When uploading the report to the Power BI service, only the anonymousWindows and basic authentication methods are available."

 

So I'm wondering if there's any neat tricks I can use to allow me to use this source, and have it published?

Thanks

 

I've tried adding /get?x-api-key=**** to the end of the URL but that's not getting me any results other than error "Cannot GET"

1 ACCEPTED SOLUTION
v-cazheng-msft
Community Support
Community Support

Hi @Anonymous,

 

You may try this solution: Edit M query in Advanced Editor and attach your Key there.

vcazhengmsft_0-1654236267237.png

 

vcazhengmsft_1-1654236267238.png

 

Here are some links you may refer to Solved: Refreshing a web source with an API Key and a dyna... - Microsoft Power BI Community and Solved: API authentication error on scheduled refresh! - Microsoft Power BI Community.

 

Or you can use Basic authorization with the ApiKeyName and ApiKey. For more details, you can refer to Solved: A web API key can only be specified when a web API... - Microsoft Power BI Community.

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!

 

Best Regards,

Community Support Team _ Caiyun

View solution in original post

2 REPLIES 2
v-cazheng-msft
Community Support
Community Support

Hi @Anonymous,

 

You may try this solution: Edit M query in Advanced Editor and attach your Key there.

vcazhengmsft_0-1654236267237.png

 

vcazhengmsft_1-1654236267238.png

 

Here are some links you may refer to Solved: Refreshing a web source with an API Key and a dyna... - Microsoft Power BI Community and Solved: API authentication error on scheduled refresh! - Microsoft Power BI Community.

 

Or you can use Basic authorization with the ApiKeyName and ApiKey. For more details, you can refer to Solved: A web API key can only be specified when a web API... - Microsoft Power BI Community.

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!

 

Best Regards,

Community Support Team _ Caiyun

Anonymous
Not applicable

@v-cazheng-msft 

Thanks for the reply!

 

Unfortunately "Basic" auth doesn't work. I get an error saying "The credentials provided for the Web source are invalid", even tough when used as header they work. 

 

I tried the suggested way you linked, with using advanced editor etc. 

This worked fine in desktop, like before. But when publishing I still can't authenticate 

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors