App registration for Power BI API use via Azure Portal

In general, to use Power BI APIs, we need to register the application with Power BI service. The application also needs to be authorized by Azure.

I used to register the app using site Power BI for Developers and manage permission via Azure Portal. Recently Power BI for Developers site was not working and I had to use Azure Portal.

Using Azure Portal proves to be one stop shop for App registrations and maintenance.

In this post I will explain in detail registering Native app & Web App for the use with Power BI API.

Register a Native App (Desktop Application using Power BI API)

Step 1:
Log on to Azure Portal

Step 2:
Scroll down to Azure Active Directory.

Select App Registrations – > New application registration

Step 3:
Enter information about application.

Example:

Name: PBIConnect

Application Type:  Native

Redirect URI: https://login.live.com/oauth20_desktop.srf

Click on “Create”

Step 4: Manage registered app (Permissions, Redirection …)

Under Azure Active Directory select App registrations

NOTE: Application ID is the Client ID.  This ID is required to connect to Power BI service when using Power BI API.

Power BI Permissions

  • Click on the application registered in Step 3.
  • Choose Settings -> Required permissions ->  Add
  • Click on Select an API & Choose Power BI
  • Select Power BI permissions.
  • Save Power BI permissions.

Azure Permissions

  • Click on the application registered in Step 3.
  • Choose Settings -> Required permissions -> Windows Azure Active Directory

 

Register a Web App (Desktop Application using Power BI API):

Registering for a Web App is similar to Native App, except for following.

  • In Step 3, while registering, choose Web app / API
  • Web app requires Client ID and Client Secret (Application ID is the Client ID).

Generating Client secret

  • Click on the application registered in Step 3.
  • Choose Settings -> Keys
  • Enter description and select expiry period and click on Save.

Client secret will be generated.

NOTE :

  •     Save the client secret. Copy the key value. You will not be able to retrieve key value after exiting the blade/window.
  •     In case key value is lost, generate a new one.

About the Author

Leave a Reply

Your email address will not be published. Required fields are marked *