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
Hi - we are using PowerBI Desktop to connect to a Web data source - our REST API providing a CSV data set... Is it possible to connect to a Web data source from the PowerBI Web Service? Doesnt seem to be possible to provide the Authentication token credential in the Web PowerBI... This seems like a basic capability - must be possible?
Solved! Go to Solution.
Ok thanks Angelia that works! So, our Web service data source is authenticated with a token; and this approach enables the token to be picked up by the Power BI Web Service Refresh implementation.
Specifically:
Make the root part of the url public and add the rest to relative path. so, it reads:
Source = Json.Document(Web.Contents("https://api.***.io/",
[RelativePath = "v1/*****141", Headers=[Authorization="api-key 42****c4"],
Query = [#"start-date" = dt5, #"end-date" = dt2 ] ])),"
Set Anonymous access.
Now our root `/api` returns 200 and we are using baseUrl and relativePath when fetching data for each endpoint.
- powerbi desktop keeps working as expected.
- powerbi service now does not complain about invalid credentials for the data source and is happy to refresh the data.
Hi @jonhopper,
After research, it's possible to connect to a Rest API datasource if the authentication method is support. Please review the following similar thread and try the solutions posted.
Power BI Online return Credential Invalid Error on Anonymous Access of API URL
Anonymous access
Refreshing a Restful Data Source with API Key
Using a REST API as a data source
Best Regards,
Angelia
Ok thanks Angelia that works! So, our Web service data source is authenticated with a token; and this approach enables the token to be picked up by the Power BI Web Service Refresh implementation.
Specifically:
Make the root part of the url public and add the rest to relative path. so, it reads:
Source = Json.Document(Web.Contents("https://api.***.io/",
[RelativePath = "v1/*****141", Headers=[Authorization="api-key 42****c4"],
Query = [#"start-date" = dt5, #"end-date" = dt2 ] ])),"
Set Anonymous access.
Now our root `/api` returns 200 and we are using baseUrl and relativePath when fetching data for each endpoint.
- powerbi desktop keeps working as expected.
- powerbi service now does not complain about invalid credentials for the data source and is happy to refresh the data.
Hi @jonhopper ,
Seems like I am in the same situation as you were in.
So you just had to change the M language in the query and then publish it? No need to add a data source in Power BI Sevice?
I have one query getting the token, and then a couple of others getting data from different api resources. Currentely getting that one of my data sources does not support a refresh at the moement.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 56 | |
| 55 | |
| 31 | |
| 18 | |
| 14 |