Power BI (Embed dashboard with Vue.js and Power BI REST API using Postman). Part 2 (Azure).

Tetiana Farhuts
4 min readNov 26, 2021

--

Implementation details:

  1. Create an Azure account
  2. Create Azure Active Directory tenant to use with Power BI
  3. Register an Azure AD application
  4. Relationship between application objects and service principals
  5. Create Azure security group
  6. Enable Power BI workspace access
  7. Add the service principal to your workspace

❗️Helpful Links

1. Create an Azure account

  • Go to https://www.azure.com and click the green Start free button.
  • Next, click another Start free button.
  • If you already have an account with Microsoft, for example, Microsoft 365, you’ll be prompted to log in. Check out the PART 1 (Power BI Service) of this post, Set up a Power BI account section to set up a Microsoft 365 account.
  • Follow the prompts to verify your account.
  • You may need to provide a valid credit card. Setting up a trial account is free (at the time of publishing this post). Microsoft just wants to see your card to verify your identity.

2. Create Azure Active Directory Tenant

To integrate Power BI into your custom application, you need to define an application in Azure AD that requires an Azure AD directory. This directory is your tenant.

3. Register an Azure AD application

An Azure AD Application is a digital identity and some associated configuration which informs Azure AD about how to treat software which uses that digital identity.

  • Log into Microsoft Azure.
  • Search for App registrations and click the App registrations link.
  • Click New registration.
  • Fill in the required information.
  • Click Register.
  • After registering, write down the Application ID, Object ID and Directory (tenant) ID that are available in the Overview tab. We’ll need them later.
  • Go to the Certificates & secrets tab.
  • Click New client secret. Enter a description and specify when you want the client secret to expire, and click Add.
  • Copy and save the Client secret value for later use.

4. Relationship between application objects and service principals

There is no way to directly create a service principal. When you’ve completed the app registration, you have a globally unique instance of the app (the application object) with a globally unique ID for your app (the app or client ID) located in your home tenant or directory.

After registering an application in the portal, an application object as well as a service principal object are automatically created in your home tenant.

The application object is the global representation of your application for use across all tenants, and the service principal is the local representation for use in a specific tenant.

Think of the application registration as the template that is used to create the service principal, and the service principal is a security principal (like a User) that can be authenticated and authorized.

5. Create an Azure AD security group

Your service principal doesn’t have access to any of your Power BI content and APIs. To give the service principal access, create a security group in Azure AD, and add the service principal you created to that security group.

6. Enable workspace access

For an Azure AD app to be able to access the Power BI content and APIs, a Power BI admin needs to enable service principal access in the Power BI admin portal.

  • Login into Power BI.
  • Go to the workspace you want to enable access for.
  • Go to Settings and select Admin portal.
  • On the Tenant Settings tab, scroll down to the Developer Settings section.
  • Enable Embed Content in apps.
  • Enable service principals to use the Power BI APIs and add the previously created security group.
  • Add the security group you created in Azure AD, to the specific security group section in the Developer settings.

7. Add the service principal to your workspace

  • Go to the workspace you want to enable access for, and select Workspace access.
  • Add 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.
  • From the drop-down menu, select Member or Admin.
  • Select Add.

👉 PART 3 (Power BI Rest API using Postman)

--

--

Tetiana Farhuts

I write about things related to programming, in the simplest way I can.