Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello! I had been struggling to make a connection with a REST API that also requires user authentication (for reference, Epicor) in Power BI Desktop. I eventually found a messy solution by using a query that hardcodes the API key and valid user credentials in the headers, and passes it to Web.Contents (which is not ideal, so if anyone has any other ideas please let me know!). For authentication, I'm using anonymous.
This is the structure:
= let url = "", username = "", password = "", apiKey = "", encodedCredentials = Binary.ToText(Text.ToBinary(username & ":" & password), BinaryEncoding.Base64), headers = [#"Authorization" = "Basic " & encodedCredentials, #"X-API-Key" = apiKey], source = Json.Document(Web.Contents(url, [Headers=headers])) in source
Where I'm stuck now is that when I view the published report in Power BI Service, it's not allowing me to refresh since it's saying the credentials are invalid. Is there something else I should try? I'm mostly not sure why it works in desktop and not on the web version.
Solved! Go to Solution.
Hi @CMoerchen,
Thank you for reaching out to Microsoft Fabric Community Forum.
Power BI Service requires fixed base URLs when using Anonymous authentication with custom headers. Your current scenario likely uses a dynamic url string, which Power BI blocks in the cloud.
Go to Dataset Settings > Set the credential method to "Anonymous".
Ensure that BaseUrl is listed as the data source.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Regards,
Vinay Pabbu
Hi @CMoerchen,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Vinay Pabbu
Hi @CMoerchen,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Vinay Pabbu
Hi @CMoerchen,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.
Regards,
Vinay Pabbu
Hi @CMoerchen,
Thank you for reaching out to Microsoft Fabric Community Forum.
Power BI Service requires fixed base URLs when using Anonymous authentication with custom headers. Your current scenario likely uses a dynamic url string, which Power BI blocks in the cloud.
Go to Dataset Settings > Set the credential method to "Anonymous".
Ensure that BaseUrl is listed as the data source.
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Regards,
Vinay Pabbu
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 11 | |
| 7 | |
| 4 | |
| 3 | |
| 3 |