Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Power BI Embedded Sample in Flask framework

Requirements

  1. Python 3

  2. IDE/ Code Editor (Recommended is Visual Studio Code)

Set up a Power BI app

  1. For Master user, register a Native app here and for Service Principal, register a Server-side web app by following this.

  2. Select "Read all datasets" and "Read all reports" permissions during Power BI app setup. Refer to thedocumentation for registering a Power BI app.

    Refer to the documentation for the complete list of Power BI permissions.

Set up Python Flask on a Windows machine

  1. Install Python 3 and add its installation path to the Path environment variable.

  2. Run the following command in CMD/PowerShell in the path where requirements.txt file is located.

    pip3 install -r requirements.txt

Run the application on localhost

  1. Open IDE.

  2. Open powerbiembedding folder.

  3. Fill in the required parameters in config.py file related to AAD app, Power BI report, workspace, and user account information.

  4. Run the following command in CMD/PowerShell to start the application.

    flask run

  5. Open http://localhost:5000 in browser or follow the direction in the output log.

Note: Whenever you update the config file you must restart the app.

Important

For security reasons, in a real world application, password or secret should not be stored in config. Instead, consider securing credentials with an application such as Key Vault.