Setup Power BI Web App

The Power BI service (SaaS) and the Power BI Embedded service in Azure (PaaS) have APIs for embedding your dashboards and reports.
To call these Power BI APIs requires you to create a Power BI Web application.
Follow the steps below to register a new application.
  • TPC 6.0
  • TPC 5.3 and older

Prerequisites

To get started, you are required to have:

  • service principal (app-only token).
  • You need to have your own Azure Active Directory tenant setup.

Follow the steps below to register a new application using a Service Principal to authenticate.

  1. Navigate to https://portal.azure.com/ and sign in.
  2. Under Azure Active Directory > App registrations, click “New Registration”.
  3. Specify any Application Name and select a Supported account type, which determines who can use the application. Click the Register Button.

  4. Register App

  5. On the left panel, click “API Permissions
    1. Click “Add a permission”.
    2. On the right panel, select Power BI Service.
    3. Select “Delegated Permissions
    4. Check the following boxes:

    5. add-permissions

    6. Click on “Add Permissions
  6. Create a Client Secret:
    1. On the left panel, select “Certificates & secrets”.
    2. Select Client secrets -> New client secret
    3. Provide a description of the secret and a duration. When done, select  Add.Client Secret
    4. Copy the secret value because you will not be able to retrieve the key later. 
  7. Save your Tenant ID for later.

    Tenant ID

  8. Create a security group on Azure AD

    1. On the Active Directory page, select  Groups and then select New group

    Security Group


    1. For “Group type” select Security
    2. Add a Group Name and Description
    3. For “Membership type” select Assigned
    4. Click on “Members” and add the Application you just created

    Security Group Members

    1. Click Create

  9. Enable service principal in the Power BI service admin settings:

    1. Navigate to https://app.powerbi.com/ and login as a Power BI admin.
    2. Under Settings > Admin Portal > Tenant Settings > Developer Settings > Allow service principals to use Power BI APIs.
    3. Set the setting to “Enabled”.
    4. Select “Specific security groups” and add the security group you created in Azure AD.

    Pbi Admin Setup


    1. Click Apply

  10. Add the service principal to your workspace

    1. Scroll to the workspace you want to enable access for, and from the  More menu, select Workspace access.

    2. Workspace Access


    3. In the Access pane, text box, add one of the following:
      1. Your service principal. The name of your service principal is the Display Name of your Azure AD app, as it appears in your Azure AD app's overview tab.
      2. The security group that includes your service principal
    4. From the drop-down menu, select Member or Admin.

    5. Select Add

  11. Workspace Access 2

Note: Make sure your account has the required permission to access the application.

Embed your content

 

To display reports in The Portal Connector using the Power BI Web app, you would need to configure the application in The Portal Connector as follows:

  1. Navigate to the Sitefinity backend
  2. Go to Administration > Settings > Advanced > PortalConnectorMvcPowerBI > Application Configurations
  3. Click Create New
  4. Fill in the App Name. It does not have to match your App Name configured previously
  5. Fill in the App Id (copy from Azure)
  6. Fill in Client Secret and Tenant ID.
  7. The Redirect URI should be the same as the Azure app.
  8. Check the Use Persistent Access Token Cookies if you want to save your Access Tokens with an expiry date. Leave it unchecked to indicate that the Token will only be used during the current user session

TPC Config

 

Assign a workspace to a capacity

In order to embed content to your portal, you need to assign a Power BI Embedded capacity to your workspace where your content is located.

Ps.: Before creating a Power BI Embedded capacity, make sure you have signed into Power BI at least once.

Follow these steps to create a Power BI Embedded capacity on Azure:

  1. Navigate to https://portal.azure.com/  and sign in.
  2. In the search box, search for Power BI Embedded.
  3. Within Power BI Embedded, select Add.
  1. Fill in the required information and then click Review + Create.
    Capacity

Follow the steps below to assign a capacity to a workspace:

  1. Navigate to https://docs.microsoft.com/en-us/rest/api/power-bi/capacities/groups_assigntocapacity
  2. Click “Try it” and sign in with your Azure Account.

    Capacity Assign

    Capacity Assign 2

  3. Fill in the “groupId” which is the ID of your workspace and “ capacityID” which is the ID of your capacity created in the previous step.

    1. You can find the workspace ID by navigating into the workspace on Power Bi service.

      Workspace ID
    2. You can find the capacity ID by navigating to Power BI Admin portal > Capacity Settings > Power BI Embedded tab.

      Pbi Admin Porta;

    3. Locate your capacity in the list and click the engine icon to view the capacity settings:

      Capacity ID

  4. After inputting the information, click “Run

    Capacity Assign 3

  5. After you select Save, you should see a  diamond next to the workspace name.
  1. Navigate to https://app.powerbi.com/embedsetup, select "Embed for your customers" and sign in as a Power BI/Azure administrator.

     

    sign-in-power-bi

  2. Specify any App Name and select the following permissions:


  3. Then register your app by clicking on “Register” button. Note the Application ID
    register-complete-power-bi
  4. (Optional) Create a workspace (step 3) by giving it a name and upload some content (step 4)
  5. Finally, click "Grant Permissions" to allow your app to access the Power BI APIs, on the window that opens, click "Accept"

     

    To display reports in The Portal Connector using Power BI Web app, you would need to configure the application in The Portal Connector as follows:

    1. Navigate to the Sitefinity backend
    2. Go to Administration > Settings > Advanced > PortalConnectorMvcPowerBI > Application Configurations
    3. Click Create New
    4. Fill in the information, the App Name here does not have to match your App Name configured previously. The username and password should be for a user that has access to view all the reports/dashboards you want to view.