How to analyze PowerBI logfiles automated using REST API with Logic Apps and Azure Log Analytics Workspace

Overview of the components used
This is the result we want to achieve: Some PowerBI logfiles, automatically sent to Azure Log Analytics Workspace, to setup some monitoring and alerting or get some other insights like dataset processing durations.

Preconditions

  1. You need an Azure Subscription and Azure AD (AAD) admin privileges.
  2. You need a PowerBI Service subscription and PowerBI admin privileges.

Step 1: Register PowerBI App within Azure AD

  • App Client ID -> Note the ID, we will use it later
  • Tenant ID -> Note the ID, we will use it later
  • App (Client ID)
  • Directory (Tenant) ID
  • App Secret Value
Please note: there is one special permission on tenant level, as shown in this picture. If you select those permissions, you need to grant admin privileges.

Step 2: Create an Azure Logic App Custom Connector

  • Authentication Type: OAuth 2.0
  • Identity Provider: Azure Active Directory
  • Client ID: Here we use our App (Client) ID we noted down in the step above…
  • Secret: Here we use our Secret Value we noted down in the step above…
  • TenantID: common
  • Resource URL: Here we use the noted resource url from the step abvove (https://analysis.windows.net/powerbi/api)
  • Scope: openid
  • Redirect URL: This will be generated, once you hit the “update connector” button (this we will need later to configure the App in AAD app registration menu.

Step 3: Add the Redirection URL to your AAD App Registration

Step 4: Logic App to Get the PowerBI Dataset Refreshes

How to get the Dataset ID from a PowerBI Report?

Step 5: Use the Data from PowerBI REST API

Step 6: Add Monitoring and Alerting Capabilities

*** Finished :-) ! ***

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Lukas Fuchs

Lukas Fuchs

I work as a Transformation Architect at Trivadis. My professional passion topics are Data Driven Business, Data Analytics and Information Design