Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
Hi guys,
I'm having some trouble with my real time dashboards embeded in our Angular web application. In my case I have some dashboards with real tiime trought Azure stream analitycs. All of the dashboards were working well bout some days ago the refresed of the data in our web stopped. When i open this dashboards in PBI service the real time data is refresed correctly but no in my application and i dont know why exactly.
In the developer tools of the browser I find some errors related with the 401 Unauthorized: Error.
Maybe the error is related with the module I use to embeded the dashboards in algular called PowerBi-client updated to version 2.22.2.
Here is some code that I'm using to embed the dashboard:
const config: IEmbedConfiguration = {
type: 'dashboard',
accessToken: accessToken,
embedUrl: embedUrl,
id: embedReportId,
pageView: 'fitToWidth',
settings: {
filterPaneEnabled: false,
hideErrors: true,
navContentPaneEnabled: this.embedUrls.tabs,
localeSettings: {
language: this.translate.currentLang,
formatLocale: this.translate.currentLang.toLowerCase()
}
}
};
// Grab the reference to the div HTML element that will host the report.
const reportContainer = <HTMLElement>document.getElementById('DashboardContainer');
// Embed the report and display it within the div container.
const powerbi2: service.Service = new service.Service(factories.hpmFactory, factories.wpmpFactory, factories.routerFactory);
powerbi2.reset(reportContainer);
this.report = powerbi2.embed(reportContainer, config);
Its a very strange error because all the content and the information of the dasboard load perfectly but it doesn't have any refresh after the initial load.
Any one know why this error occur?
Hi @TransDig ,
According to the error message, it seems that the problem was caused by insufficient privileges. Which authentication method you are using when embedded the report? Service principal or Master user? If you are using service principal, please check if grant the proper access for below steps:
Step 6 - Service principal API access
Step 7 - Enable workspace access
In addition, the following links are the ones which have the similar problem as yours. Hope their solution can help you solve the problem.
401 Unauthorized: Error while retrieving Embed URL (embed power bi for customers-Python)
Power Bi REST API - 401 Authorization error when using Service Principals
Power BI REST API - 401 Authorization error when using app secret/service principal
Best Regards
Hi @v-yiruan-msft Thanks a lot for the response.
I tried to use one of the samples code provided in Embed content in your Power BI embedded analytics application - Power BI | Microsoft Learn page.
I sucesfully added the Service Principal autentication using a .net scenario but after sucessfully loaded one of our real time dashboards in the demo app the problem is the same. The dashboards (tiles, tables... etc) load perfectly but i cant see the refresh of the dashboard after the initial load.
I dont know where is the problem. Maybe in the power bi service or the app registered on Azure AD. The dashboards in power bi service is working well with the real time data from a push dataset but for any reason I cant see this refresh in a embeded scenario.
¿Any ideas?
Thanks a lot for the help.
I have the EXACT same problem right now, same error message 401 in an embedded SaaS app that I've built for Power BI customers. Any ideas from anyone? It's like it's an internal problem within Microsoft/Azure or the Javascript SDK files.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!
Check out the February 2025 Power BI update to learn about new features.