All Content
Timespan
explore our new search
Using Power BI REST APIs in Power Automate without Service Principal
Image Source: Shutterstock.com
Power BI
Sep 26, 2023 3:18 PM

Using Power BI REST APIs in Power Automate without Service Principal

by HubSite 365 about Timo Pertilä (Forward Forever) [MVP]

Power Platform Consultant, Microsoft Business Applications MVP

Data AnalyticsPower BIM365 Hot News

Master using Power BI REST APIs in Power Automate without a service principal for seamless reporting and data analysis.

Timo Pertilä, a Microsoft MVP at Forward Forever, has published an enlightening blog post on utilizing Power BI REST APIs in Power Automate, specifically without a service principal. In his previous posts, he dived into the use of Power BI REST APIs and demonstrated how to integrate them into Power Automate with service principal. However, over time, he discovered some APIs that didn't accept service principal for authentication but required a logged in O365 account instead.

This raised challenges in Power Automate as creating an access token is required to interface with Power BI REST APIs (considered as Business Intelligence tools). Pertilä, thus, unraveled a solution to this problem by involving HTTP with the Azure AD connector.

To help others overcome similar steads, Pertilä delves into a detailed step-by-step guide on 'Invoke an HTTP request.' The unique attribute of this HTTP operation is its request for an Azure AD login, fittingly resolving the log-in impediment.

He highlighted a specific API that couldn't support service principal, called 'Get Gateways.' The aim of this API is to return a list of gateways that the user administers. To implement it, a 'flow' needs creation, which should then call an action named 'Invoke an HTTP request.' It's worth noting that this action is premium and therefore requires a license.

To proceed, the user should input 'api.powerbi.com' as the Base Resource URL, followed by an Azure AD Resource URI. More information on Power BI can be found here. A fresh connection reference is then created in the solution. To finalize, users should insert the method and URL derived from the official Microsoft document and then execute.

A broader perspective on Power BI REST APIs

With Power BI REST APIs, the possibilities for data exploitation are endless. For instance, users can create a concentrated data hub where available reports can be scanned and information can be enhanced with manually input data. Despite the minor hurdles, Pertilä still recommends the use of service principal. However, until Microsoft enables its use in all requisite APIs, the described method prevails as a highly viable workaround.

Read the full article How to use Power BI REST APIs in Power Automate without a service principal

Power BI - Guide: Using Power BI REST APIs in Power Automate without Service Principal

Learn about How to use Power BI REST APIs in Power Automate without a service principal

In recent times, there has been a surge in interest around the use of APIs with MS Power BI, especially in connection with Power Automate. Many users frequently stumble upon challenges when they try to use these APIs without a service principal for authentication. This article lays out an approach to overcome this issue.

In Power Automate, using Power BI REST APIs typically necessitates creating an access token. Ordinarily, this is achieved via a service principal. Nonetheless, certain issues can ensue when some API endpoints do not support this authentication method. Fortunately, there is a clever workaround.

A potential solution lies in the hands of an HTTP action named "Invoke an HTTP request". Differing from a standard HTTP call, it prompts for an Azure AD log-in, making it an ideal fit for this purpose.

The process of leveraging this functionality is not unduly complex. For demonstration, consider an API endpoint that does not work with a service principal, such as the 'Get Gateways' API. This API ought to return a list of gateways that the user administers, but issues can arise realizing this due to difficulties in using a service principal for this API.

To get started using the "Invoke an HTTP request" action, we initiate a new flow with a desired trigger before adding an action. Be aware that this action is premium, thereby requiring a license.

An ensuing dialog box will prompt us to populate the Base Resource URL and Azure AD Resource URI fields. More often than not, the Base Resource URL is api.powerbi.com, and the Azure AD Resource URI is analysis.windows.net/powerbi/api. The completion of these steps leads to the creation of a new connection reference to your solution.

With the groundwork established, simply insert the method and URL from the MS documentation and press 'run'. The API does not demand headers or a body. At any point, if in doubt, the 'Try it' option in the API documentation page can come in handy.

By availing of the HTTP with Azure AD functionality, we can call APIs without the need for a service principal. This lowers the barrier for low-code approach enthusiasts as it obviates the requirement to modify anything in Azure or Power BI admin settings

Despite the merits of this approach, it should be noted that using a service principal remains the recommended way of working. However, until MS makes service principal use universally feasible in APIs, this method provides a valid and useful alternative.

As a noteworthy upside, the information that these APIs deliver opens up a wealth of possibilities. For instance, one can setting up an MS Power BI report catalog where end-users can explore what reports are available. It also makes it possible for users to augment this information with manually inserted data.

This article demonstrates how with careful problem-solving and the smart application of available tools, you can circumvent systemic issues and enhance your usage of Power BIs REST APIs in Power Automate without the need for a service principal.

More links on about How to use Power BI REST APIs in Power Automate without a service principal

How to use Power BI REST APIs in Power Automate ...
Feb 2, 2023 — The MS documented way to do that is with a service principal (in Power Automate – leaving out PowerShell, Azure functions etc approaches here).
Call Power BI Rest APIs with Power Automate
Nov 18, 2022 — To grant the Azure AD app access to the Power BI content and APIs, the admin needs to enable service principal on the Power BI admin portal. Go ...

Keywords

Power BI REST APIs, Power Automate, service principal, how to use Power BI, BI REST APIs in Power Automate, without service principal, Power Automate API usage, Microsoft Power Automate, Power BI API guide, no service principal Power BI.