# Set up and configure the Power BI tenant settings

To create an app registration, you must have one of the following Microsoft Entra roles:

* Global Administrator
* Cloud Application Administrator

{% hint style="info" %}
**Note:** A Global Administrator is typically the person who signs up for the Microsoft Entra ID tenant. View the guide on [assigning Microsoft Entra roles to users](https://learn.microsoft.com/en-us/azure/active-directory/roles/manage-roles-portal) for more information.
{% endhint %}

## Create a security group

{% hint style="info" %}
**Note:** You can skip this step if you already have a security group.
{% endhint %}

1. Type "**Microsoft Entra ID**" in the [Azure portal](https://portal.azure.com) search bar and select said option as it appears.

   <figure><img src="https://2147433183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Am7TO0x29a6l1P0wMUg%2Fuploads%2Fgit-blob-b2eba2cf875d316a7ad9ed2ae328e2c157786325%2F16.2.png?alt=media" alt=""><figcaption></figcaption></figure>
2. Select **Groups** (under Manage) from the left pane.

   <figure><img src="https://2147433183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Am7TO0x29a6l1P0wMUg%2Fuploads%2Fgit-blob-fca4be856fc7436999035f879881117baa2e89cd%2F16.5.png?alt=media" alt=""><figcaption></figcaption></figure>
3. Click on **New group** to create a new security group.

   <figure><img src="https://2147433183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Am7TO0x29a6l1P0wMUg%2Fuploads%2Fgit-blob-58f8be2e1a5e9175fb4b381c798ae06f95f1c38a%2F16.6.png?alt=media" alt=""><figcaption></figcaption></figure>
4. Fill out the New Group form as detailed below: \\

   <figure><img src="https://2147433183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Am7TO0x29a6l1P0wMUg%2Fuploads%2Fgit-blob-0ef53863a544bb60f5b4ff6a0d155124cd6a6421%2F6.3.png?alt=media" alt=""><figcaption></figcaption></figure>

   * Group type: "**Security**"
   * Group name: Create a name for the group. In our example, we named the group PowerBIPLA, hence it will be referred to as such in this documentation's images, etc. Feel free to create your own group name.
   * Group description: Optional.
   * Membership type: Pre-selected, it should be "**Assigned**".
5. Click **Create** to create the security group.

## Add the LoadFAST API App registration to the security group

1. Select **All groups** from the left pane of the Microsoft Entra ID page.
2. Type your security group's name in the search bar and click on it.

{% hint style="info" %}
**Note:** As mentioned in the previous section, we named our group PowerBIAPISG, hence it will be referred to as such in this documentation.
{% endhint %}

<figure><img src="https://2147433183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Am7TO0x29a6l1P0wMUg%2Fuploads%2Fgit-blob-bbae9c3ff86022a849f70e9545c398a360cb793e%2F16.7.png?alt=media" alt=""><figcaption></figcaption></figure>

3. Select **Members** (under Manage) from the left pane and click on **Add members**.

   <figure><img src="https://2147433183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Am7TO0x29a6l1P0wMUg%2Fuploads%2Fgit-blob-cdf68ee263980b210ee07d58e7a7e82c086c5392%2F6.5.png?alt=media" alt=""><figcaption></figcaption></figure>
4. Search for the name of the app registration created for the LoadFAST API also select the users to be running the PowerShell script for the tool and select it. Click on the **Select** button to add the app registration with Users to the security group.

   <figure><img src="https://2147433183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Am7TO0x29a6l1P0wMUg%2Fuploads%2Fgit-blob-d1213505b3372bb33edbc93a5677c55884037278%2F6.6%20(2).png?alt=media" alt=""><figcaption></figcaption></figure>

## Grant the app registration access on the Power BI workspace

Granting the app registration (also known as the service principal) member-level access to a Power BI workspace is required to calculate the PLT for that workspace's reports.

{% hint style="info" %}
**Note:** Repeat the following steps for **each** workspace where the LoadFAST will be used to calculate the PLT of that workspace's reports.
{% endhint %}

1. Go to the [Power BI web application/Power BI Service](https://app.powerbi.com/).
2. Go to the workspace that you want to grant the tool access to.

   <figure><img src="https://2147433183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Am7TO0x29a6l1P0wMUg%2Fuploads%2Fgit-blob-e01bd21947479fa9a2edb2f4f5ca7523e3b8327e%2F9.5.png?alt=media" alt=""><figcaption></figcaption></figure>
3. Click on **Manage access** once on the workspace.

   <figure><img src="https://2147433183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Am7TO0x29a6l1P0wMUg%2Fuploads%2Fgit-blob-3775a27d476e633c9fc6e367052267550cf1ef50%2F9.1.png?alt=media" alt=""><figcaption></figcaption></figure>
4. Select **Add people or groups**.

   <figure><img src="https://2147433183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Am7TO0x29a6l1P0wMUg%2Fuploads%2Fgit-blob-2b3c533a61e9e01ff3835a25fe89ef4c623c2092%2F9.6.png?alt=media" alt=""><figcaption></figcaption></figure>
5. Enter the name of the service principal (name of the app registration) which was created [previously](https://maqsoftware.gitbook.io/pbi-load-analyzer-technical-documentation/setting-up/pre-deployment/create-an-app-registration-for-the-loadfast-api#create-an-app-registration).

   <figure><img src="https://2147433183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Am7TO0x29a6l1P0wMUg%2Fuploads%2Fgit-blob-643acdaf8dcc29ac8652bafc0fbe875d9f31066b%2F9.2.png?alt=media" alt=""><figcaption></figcaption></figure>
6. Select the Member role as **Member**.

   <figure><img src="https://2147433183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Am7TO0x29a6l1P0wMUg%2Fuploads%2Fgit-blob-7a8cce87c18f9279540a70f110365bd34be29461%2F9.3.png?alt=media" alt=""><figcaption></figcaption></figure>
7. Click **Add** to assign the role.

   <figure><img src="https://2147433183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Am7TO0x29a6l1P0wMUg%2Fuploads%2Fgit-blob-531f8ce6b21afe7fa9f1d46b51c5de1721a42fd1%2F9.4.png?alt=media" alt=""><figcaption></figcaption></figure>
8. Repeat the above steps for all the workspace that you want to add or provide access to the service principal to calculate the Page Load Time for that workspace reports.

## Configure the tenant settings

1. Go to the [Power BI web application/Power BI Service](https://app.powerbi.com/).
2. Click on the settings icon on the top right-hand corner and sign into the **Admin portal** using your Power BI administrator credentials (only an administrator account can access these settings).

{% hint style="info" %}
**Note**: The Power BI service must be in the same tenant where you will deploy the LoadFAST tool.
{% endhint %}

<figure><img src="https://2147433183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Am7TO0x29a6l1P0wMUg%2Fuploads%2Fgit-blob-9d224113132b35b9e59038ff8fd5d1e9d7ce2095%2F10.1.png?alt=media" alt=""><figcaption></figcaption></figure>

3. Once you're on the **Tenant settings** page, modify the settings detailed below:

<figure><img src="https://2147433183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Am7TO0x29a6l1P0wMUg%2Fuploads%2Fgit-blob-7a2c523bf50a206b69d186c52d03dc8e569a1db3%2F10.2.png?alt=media" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Note:** Ensure that the LoadFAST API app registration was added to the security group as detailed in [this step](https://maqsoftware.gitbook.io/pbi-load-analyzer-technical-documentation/setting-up/pre-deployment/set-up-and-configure-the-power-bi-tenant-settings#add-the-loadfast-api-app-registration-to-the-security-group). This is needed to make sure the required access can be granted and the tool can work properly.
{% endhint %}

**Developer settings**

Scroll down within the Tenant settings page to find the **Developer settings**. These settings are required for the app registration created to use Power BI related APIs. Configure the setting as detailed below:

* Expand the **Allow Service Principals to create and use profiles** setting. Enable the setting using the toggle.

  <figure><img src="https://2147433183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Am7TO0x29a6l1P0wMUg%2Fuploads%2Fgit-blob-b3d1d6ea1b19523a7e02109465ebd6d124f69045%2FService%20principals%20can%20use%20Fabric%20APIs.png?alt=media" alt=""><figcaption></figcaption></figure>
* Under the **Apply to** section, add the previously created/your selected security group into the **Specific security groups** section. Click **Apply** to save the changes.

## **Assign capacity to your Power BI workspace**

{% hint style="info" %}
**Note:** Skip this step you are using a Premium workspace.
{% endhint %}

1. Go to the [Power BI web application/Power BI Service](https://app.powerbi.com/).
2. Select **Workspaces** from the left-hand menu.

   <figure><img src="https://2147433183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Am7TO0x29a6l1P0wMUg%2Fuploads%2Fgit-blob-5aa08c6510915e82a6f391fd795e6d9161bf9429%2F9.5%20(2).png?alt=media" alt=""><figcaption></figcaption></figure>
3. Find the workspace you're using for embedding your content. Click on **...** next to the workspace's name and select **Workspace settings**.

   <figure><img src="https://2147433183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Am7TO0x29a6l1P0wMUg%2Fuploads%2Fgit-blob-d0c174cde9aee1c5b9b1bda65c38e806d51c9556%2F11.2.png?alt=media" alt=""><figcaption></figcaption></figure>
4. Select the **Premium** tab and do the following:
   * Under **License mode**, select the type of capacity you created [previously](https://maqsoftware.gitbook.io/pbi-load-analyzer-technical-documentation/setting-up/prerequisites/set-up-power-bi-and-azure#power-bi-capacity): Premium capacity or Embedded.

     <figure><img src="https://2147433183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Am7TO0x29a6l1P0wMUg%2Fuploads%2Fgit-blob-6251cc6cadcc7b066f13cc5b73eb925e0e439354%2F11.3.png?alt=media" alt=""><figcaption></figcaption></figure>
   * Select the capacity previously created and select **Apply** to save the changes.

     <figure><img src="https://2147433183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Am7TO0x29a6l1P0wMUg%2Fuploads%2Fgit-blob-322530f8b5869cbd1e170e42c06fc96886cae0ee%2F11.5.png?alt=media" alt=""><figcaption></figcaption></figure>
5. After you assign your workspace to a capacity, a diamond appears next to it in the Workspaces list.

   <figure><img src="https://2147433183-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3Am7TO0x29a6l1P0wMUg%2Fuploads%2Fgit-blob-286efbe1cd80060714065fcc6a54f23712c2b300%2F11.4.png?alt=media" alt=""><figcaption></figcaption></figure>
