Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
I am unable to authenticate web api source. The authentication uses Bearer authentication and I am able to get data in PBI Desktop.
Here is some sample code from power query:
Source = Json.Document(Web.Contents(StaticPathVar, [Headers=[Authorization="Bearer xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",RelativePath = "?createdAfter=" & Year & "-" & FromMonth & before & Year & "-" & ToMonth & url]])),
As one can see the api key is provided in the code. But PBI Service want's to authenticate the datasource seperatly as is normal with sql data, excel data, csv files and so forth.
If one presses the edit credentials the pop window askes for authentication method.
But there is no way to authenticate the web api datasource like this in the service.
Are there any work around to bypass this authentication.
Instead of passing your parameters using RelativePath, use Query instead
vOptions = [RelativePath=vPath, Query=[page=Text.From(vPage), pagesize=Text.From(vPageSize)], Headers=[Accept="...-v1+json"]],
That did not do the trick - but i am problably doing this all rong. Tried this code
Source = Json.Document(Web.Contents(StaticPathVar, [Headers=[Authorization="Bearer xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",Query = "?createdAfter=" & Year & "-" & FromMonth & before & Year & "-" & ToMonth & ur
]])
),
...some other code.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.