Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
Hi
I want to load data into my report in Power BI Report Server from an API REST. In this document Power BI report data sources in Power BI Report Server - Power BI | Microsoft Learn apparently it's supported ("web" source) using import mode (as far as i understand cached data means import mode) and even it could has an scheduled refresh. Has anyone used this connector to load data from APIs? are there any concerns that i should be aware if we try it?
Thanks in advance
best regards
Solved! Go to Solution.
You're absolutely right in your interpretation — Power BI Report Server does support Web data sources (which includes REST APIs) in Import mode, and yes, scheduled refreshes can be configured for them. However, there are some nuances and limitations to keep in mind.
Here’s a step-by-step overview and some important considerations:
Using Web connector (Power Query): You can use the Web.Contents function in Power Query to call REST APIs.
Import mode only: DirectQuery isn’t supported for Web sources in Power BI Report Server.
Scheduled refresh support: You can schedule refreshes on PBIRS, but there are caveats (see below).
Anonymous or Basic Auth works fine.
OAuth 2.0 is not supported on PBIRS for web sources — this is a major limitation if your API uses modern authentication protocols.
Workaround: If possible, use an intermediate proxy/API gateway that handles OAuth and exposes a simpler authenticated endpoint to PBIRS.
REST APIs are typically paginated. You’ll need to handle pagination manually in Power Query, which can make refreshes slow.
Avoid overly frequent refreshes or large datasets due to performance limits of PBIRS.
Unlike Power BI Service, you don’t need an On-Premises Gateway for scheduled refresh in PBIRS — the server itself handles refresh.
Web.Contents allows for custom headers (like tokens) and query parameters — but you must avoid dynamic parts in the URL path that rely on parameters or variables evaluated at runtime, or refresh might fail.
Here’s a sample M script to get data from a paginated API:
let GetPage = (Page as number) => let Source = Json.Document(Web.Contents("https://api.example.com/data", [ Query = [page = Text.From(Page)], Headers = [#"Authorization" = "Bearer YOUR_TOKEN"] ])), Data = Source[data] in Data, PageList = List.Generate(() => 1, each _ <= 5, each _ + 1), AllData = List.Combine(List.Transform(PageList, each GetPage(_))), Table = Table.FromList(AllData, Record.FieldValues, {"Column1", "Column2", ...}) in Table
Cache results in a staging database if refresh performance becomes an issue.
Log API call responses for audit/debug purposes.
Document token expiration and re-auth workflows if applicable.
You're absolutely right in your interpretation — Power BI Report Server does support Web data sources (which includes REST APIs) in Import mode, and yes, scheduled refreshes can be configured for them. However, there are some nuances and limitations to keep in mind.
Here’s a step-by-step overview and some important considerations:
Using Web connector (Power Query): You can use the Web.Contents function in Power Query to call REST APIs.
Import mode only: DirectQuery isn’t supported for Web sources in Power BI Report Server.
Scheduled refresh support: You can schedule refreshes on PBIRS, but there are caveats (see below).
Anonymous or Basic Auth works fine.
OAuth 2.0 is not supported on PBIRS for web sources — this is a major limitation if your API uses modern authentication protocols.
Workaround: If possible, use an intermediate proxy/API gateway that handles OAuth and exposes a simpler authenticated endpoint to PBIRS.
REST APIs are typically paginated. You’ll need to handle pagination manually in Power Query, which can make refreshes slow.
Avoid overly frequent refreshes or large datasets due to performance limits of PBIRS.
Unlike Power BI Service, you don’t need an On-Premises Gateway for scheduled refresh in PBIRS — the server itself handles refresh.
Web.Contents allows for custom headers (like tokens) and query parameters — but you must avoid dynamic parts in the URL path that rely on parameters or variables evaluated at runtime, or refresh might fail.
Here’s a sample M script to get data from a paginated API:
let GetPage = (Page as number) => let Source = Json.Document(Web.Contents("https://api.example.com/data", [ Query = [page = Text.From(Page)], Headers = [#"Authorization" = "Bearer YOUR_TOKEN"] ])), Data = Source[data] in Data, PageList = List.Generate(() => 1, each _ <= 5, each _ + 1), AllData = List.Combine(List.Transform(PageList, each GetPage(_))), Table = Table.FromList(AllData, Record.FieldValues, {"Column1", "Column2", ...}) in Table
Cache results in a staging database if refresh performance becomes an issue.
Log API call responses for audit/debug purposes.
Document token expiration and re-auth workflows if applicable.
Check out the April 2025 Power BI update to learn about new features.
Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
User | Count |
---|---|
3 | |
2 | |
2 | |
1 | |
1 |