Forum Discussion

TransDig's avatar
TransDig
Advocate I
3 years ago

Real time error 401 in embeded scenario

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?

3 Replies