For a minimal implementation see the demonstration editor:
https://bubble.io/page?type=page&name=powerbi&id=littlelambdas. *NOTE* - the report it refers to is no longer in production so you will not see a functioning embedded chart.
1. In the Plugins tab, add the plugin to your application.
2. In the Power BI plugin, enter the keys in the environment variables.
3. In the Design tab, add the Power BI Report element to your page.
4. In the Workflow tab, add the element's Initialized event.
5. In the event, add the Get Report action passing a Report Identifier, remembering to save the Dataset Identifier in a state for use in token requests.
6. In the event, add the Get Token action, passing the Report Identifier and the Dataset Identifier.
7. In the event, add the element's Embed action passing the Embed URL, Token, Report Identifier, Dataset Identifier, and calculated token renewal time.
8. In the Workflow tab, add the element's Expiring event.
9. In the event, add the Get Token action, passing the Report Identifier and the Dataset Identifier.
10. In the event, add the element's Update Token action passing the new Token and the calculated renewal time.
Plugin Keys:
"Azure Tenant" - Unique identifier of the Azure account tenant.
"Azure Client" - Unique identifier of the Azure client or application within the account tenant.
"Azure Secret" - confidential and private secret of the specific client or application
"Azure Authority" - URL of the authority providing credentialing services. Trim any trailing backslashes.
"Azure Scopes" - A comma delimited list of URLs that are within the scope of granted privileges. Trim any trailing backslashes.
"Power BI Endpoint" - Base URL of the Power BI API endpoint for constructing REST requests. Trim any trailing backslashes.
Server-Side Actions:
"Get Report" - Calls the Get Report REST API endpoint. Requires a report identifier and optionally a workspace identifier. Returns the report web URL and embedding URL along with the dataset identifier.
"Get Token" - Calls the Generate Token REST API endpoint. Requires a report identifier and a dataset identifier, optionally supports a workspace identifier and a token lifetime in minutes. Returns the token and the time of expiration.
Hints:
1. Calculate the token renewal time in seconds using "expiration - current time: formatted as seconds - 300". Microsoft recommends renewing tokens 5 (300 s) to 10 (600 s) minutes before expiry.
2. To wrap a single string in a list use the "Split by" operator and specify a delimiter that is NOT found in the string.
3. All the usual provisos apply for handling responses from third party services. The Bubble developer needs to consider cases where either Azure or Power BI servers return invalid or unusable responses, particularly when requesting Tokens and secure report URLs.