Forum Discussion
Issues Embedding Report in Salesforce
Hi Anonymous,
Regarding to issue A:
1. The client info, like client id and client secret, is surely stable. So you can hard-code them. Did you get error message that the client info is invalid?
2. Did you upload all the things in the guide post?
Regarding to issue B:
Can you provide more info? Or I would suggest you open a support ticket here.
Best Regards,
Dale
- Anonymous8 years agoNot applicable
Hi v-jiascu-msft,
Thanks for getting back to me!
1. I was able to successfully embed the report when the values were hard coded. This led me to believe the values in the Custom Setting were wrong so I deleted the Custom Setting and the App in AAD and recreated both, however, the issue ended up being that I named the Custom Setting 'PowerBI' instead of PowerBI. Now that the Custom Setting is named properly, Salesforce can access client_id, client_secret, etc, but the AccessToken and RefreshToken that are stored are for a different App so the authentication fails. I've been unable to overwrite the AccessToken and RefreshToken stored by Salesforce despite attempts to re-initiate the login process.
Research into how to overwrite OAuth tokens in Salesforce hasn't been fruitful so I'm hoping someone who understands the authenication process better might have some insight.
2. I have followed all of the steps in the guide. After the hard coded version worked I made sure all of the necessary parts exist within Salesforce and are named correctly.
As for B, I'll look into a support ticket for now.
Thank you for your time.
- Anonymous8 years agoNot applicable
Background information: The report is located in a Premium capacity workspace and the hope is to distribute the report to the Sales team without needing to grant licenses.
Some additional information about the steps I took:
- Register App with Azure AD using onboarding tool: https://app.powerbi.com/embedsetup/userownsdata (This step wasn’t done as the service account, not sure of the implications of that)
- Grant permissions in AAD as Service Account (master account, admin of workspace)
- Create Salesforce Custom Setting OAuthApp_pbi
- Populate Custom Setting for PowerBI with AAD endpoints along with client id/secret
- Create OAuthController and PowerBIController Apex Classes with code from: https://github.com/Microsoft/BusinessPlatformApps/tree/dev/Samples/Salesforce/EmbedPowerBIReport
- Add Azure AD to Salesforce’s Remote Site Settings
- Create Visualforce Page with code from GitHub repo linked above
- Add Report ID to Visualforce page code
- Navigate to Visualforce page located at: OurSalesforceInstance.com/apex/PowerBI
- In pop up window, log in as the Service Account
Once all of these steps have been completed the iframe renders within Salesforce, but displays "This content is not available". Based on this blog post ( https://www.linkedin.com/pulse/success-power-bi-embedded-salesforce-fred-kaffenberger/ ) my next debugging step would be to use Fiddler to inspect the requests/replies. I'll work on that, but hopefully this additional information might point out where I went wrong.
Let me know if you have any ideas.
Thanks!