Hello, having a tricky problem.
We use a connector for JSM to PowerBI to create a report, and we have the report set up with Embed Capacity and token authentication.
Reviewing PowerBI embed documentation: https://learn.microsoft.com/en-us/power-bi/developer/embedded/embedded-analytics-power-bi
There is an option to embed a report where our client can view the report without personally authenticating. We've generated a token and amended the script found here to match our details: https://learn.microsoft.com/en-us/javascript/api/overview/powerbi/embedding-solutions#embed-for-your-customers
Since the script is JavaScript, I found this Confluence KB article: How to use JavaScript in Confluence | Confluence | Atlassian Documentation
But now I'm a bit stuck - I'm not really a code guy, and this is beyond my technical abilities.
As I read it, I should insert the code directly in a script block like:
<iframe title="Title Here" width="1140" height="541.25" src="https://app.powerbi.com/reportEmbed?reportId=id-here" frameborder="0" allowFullScreen="true">
</iframe>
<script type="text/javascript">
let models = window['powerbi-client'].models;
let embedConfiguration = {
type: 'report',
id: 'id here',
embedUrl: 'https://app.powerbi.com/reportEmbed',
tokenType: models.TokenType.Embed,
accessToken: 'token here' };
var $dashboardContainer = $('#embedContainer');
var dashboard = powerbi.embed($dashboardContainer.get(0), embedConfiguration);
</script>
I'm not sure where I'm going wrong here, I literally don't have the first clue - does the iframe block need to be inside the script, does the script need to be inside the iframe block, do I need to include something with the JQuery stuff, I just don't know - any advice appreciated.
This is on Confluence Server so I don't have the option of buying an add-on to solve this, nor do I have the option of buying an add-on to replace PowerBI.
@Aaron Williams Was all of the code shared above created together? Does your code actually have an access token and id?
Hi Brant, the solution turned out to be a lot more involved than simply producing the code - yes it did have an access token and id but naturally I took these out for asking the question.
Internally I got a Software Engineer to work with me on understanding the Microsoft documentation to build the final code, he was able to better navigate the Microsoft documentation to understand how to put it together, and I have no idea how, but it all works as needed now anyway.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you share your working solution?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.