Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Power BI credentials encryption sample in Spring MVC framework

Requirements

  1. JDK (or JRE)
    Find the steps to add Java path to environment variable here
    To check if you have working JDK execute java -version in terminal

  2. Eclipse IDE (Download Eclipse for Enterprise Java Developers)

  3. Apache Tomcat (Download binary distributions)

Set up a Power BI app

Follow the steps on aka.ms/EmbedForCustomer

Steps to build and run

  1. Open Eclipse and Click Window > Show View > Select Servers.

  2. Setup Tomcat server

    1. Go to Servers tab, click No servers are available. Click this link to create new server...
    2. Select v9.0 Tomcat version from Apache
    3. Click Next
    4. Click browse, then select the folder which contains Tomcat
    5. Select JRE which is available through system variable
    6. Click Finish
    7. There should be a Tomcat server now in the Servers tab
  3. To import project, Click File > Open Project from File System > Click on Directory > Select Update Credentials folder > Finish

  4. Let Maven finish automatically downloading the dependencies in background.

  5. Add Tomcat server to the project

    1. Right click EncryptCredentials (project's name) from Project Explorer and then click Properties
    2. Select Targeted Runtimes
    3. Select Apache Tomcat from the list
    4. Click on Apply and Close
  6. Fill in the required parameters in the Config.java file related to AAD app, Power BI report, workspace, and user account information.

  7. Run the project

    1. Right click project's name from Project Explorer
    2. Select Run As > Run on Server
    3. Select the created server and click Finish
    4. http://localhost:8080/encryptcredential should open in browser

Supported browsers:

  1. Google Chrome

  2. Microsoft Edge

  3. Mozilla Firefox

Important

  1. For security reasons, in a real world application, passwords and secrets should not be stored in config files. Instead, consider securing your credentials with an application such as Key Vault.

  2. Do not use default browser provided by eclipse for running the sample on server.

Note:

  1. The Azure AD Service Principal which is used for authentication should have admin rights on the corresponding workspace.
  2. If Service Principal mode is used for authentication and on-premises gateway is used, then SP should be the gateway admin.

Troubleshoot

Windows shows "File path too long" during Eclipse IDE setup extraction.

Skip the files during extraction whose paths are too long

Windows shows error popup while trying to run the eclipse.exe file.

Check the size of the extracted Eclipse setup folder. It should be ~599 MB.

Eclipse shows "Building has encountered a problem" or "Maven is not configured properly" error after importing the project.

  1. Delete folder named 2.6 from %userprofile%\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\ directory
  2. Right click project's name from Project Explorer > Maven > Update Project > Check Force Update of Snapshots/Releases > Click Ok

Eclipse shows "The server cannot be started because one or more of the ports are invalid. Open the server editor and correct the invalid ports." error while starting the Tomcat server.

  1. Click on Servers tab on the event log area of the IDE
  2. Double click on the server name which says "Tomcat v9.0 Server at localhost..."
  3. Set the Tomcat admin port to any available port (for e.g. 8079)

"Run on Server" option is not visible for running the project.

  1. Right click on the project > Properties > Project Facets
  2. Select Dynamic Web Module, Java, and JavaScript options are selected.
  3. Click on Apply and Close.