This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
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
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |