Coder Social home page Coder Social logo

Comments (7)

bapat-atharva avatar bapat-atharva commented on September 23, 2024

Hi @rush2kasi6401,

The powerbi-service should be able to automatically detect the environment you are trying to embed with.
Can you let us know how you are generating the embed-url and the access-token ? Can you also let us know the request body where the referrer is app.powerbi.com ?

from powerbi-client-angular.

rush2kasi6401 avatar rush2kasi6401 commented on September 23, 2024

We are using the following code to set the token (Service Priciple) and Embed Url.

try {
// reportConfigResponse = await this.pbiService.getEmbedConfig().toPromise();
forkJoin(
[ this.pbiService.getEmbedTripsConfig()]
).subscribe(
([res]) => {
reportConfigResponse = res
}
).add(() => {
// Update the reportConfig to embed the PowerBI report
this.reportTripsConfig = {
...this.reportConfig,
id: reportConfigResponse.Id,
embedUrl: reportConfigResponse.EmbedUrl,
accessToken: reportConfigResponse.EmbedToken.token
};
});

    } catch (error: any) {
      this.displayMessage = `Failed to fetch config for report. Status: ${error.status} ${error.statusText}`;
      console.error(this.displayMessage);
      return;
    }

Here is the API code to get token
[HttpGet]
[Route("api/PbiAuth/EmbedReportConfig")]
public async Task EmbedReportConfig()
{
var embedResult = await m_embedService.EmbedReport();
if (embedResult)
{
return m_embedService.EmbedConfig;
}
else
{
return m_embedService.EmbedConfig;
}
}

We don't have an issue generating token or getting embed url.

Here is the embed URL:
https://app.powerbigov.us/reportEmbed?reportId=1a1f947a-e0de-4cf8-a645-27f22730f6d4&groupId=531ebe59-d47a-4846-87ec-61fe1790de34&w=2&config=eyJjbHVzdGVyVXJsIjoiaHR0cHM6Ly9XQUJJLVVTLUdPVi1JT1dBLXJlZGlyZWN0LmFuYWx5c2lzLnVzZ292Y2xvdWRhcGkubmV0IiwiZW1iZWRGZWF0dXJlcyI6eyJtb2Rlcm5FbWJlZCI6dHJ1ZSwidXNhZ2VNZXRyaWNzVk5leHQiOnRydWV9fQ%3d%3d

However, getting below failures and failed to load report. I am confused, why referer is having: https://app.powerbi.com
image

from powerbi-client-angular.

bapat-atharva avatar bapat-atharva commented on September 23, 2024

Thank you for the information. I am assuming you are using the correct environment config for authenticating and making requests to powerbi similar to here.
We will check and let you know if we find anything.

from powerbi-client-angular.

rush2kasi6401 avatar rush2kasi6401 commented on September 23, 2024

from powerbi-client-angular.

rush2kasi6401 avatar rush2kasi6401 commented on September 23, 2024

@bapat-atharva - Here is more information on how we successfully embedded a sample commercial cloud dashboard. Whereas gov cloud report failed to embed due to CROS Issue as shown in below figures

image

image

from powerbi-client-angular.

bapat-atharva avatar bapat-atharva commented on September 23, 2024

Thank you @rush2kasi6401 for getting back with more information. We were able to embed using the US gov environment when we tried to, but we need to check for when migrating from Angular 10 to 14.

As I understand you were able to embed in a brand new Angular 14 application, so I am not sure if the issue lies with the package. We will update if we find anything.

from powerbi-client-angular.

rush2kasi6401 avatar rush2kasi6401 commented on September 23, 2024

from powerbi-client-angular.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.