Category Archives: PowerBI

M365Permissions v1.0.8

Changes:

  • [Feature] Added ServicePrincipals to scannable resources
  • [Feature] Increase scan speed of Entra (enumeration of users and groups)
  • [Feature] Make output folder configurable
  • [Feature] Better memory handling
  • [BugFix] SpO authentication concurrent auth cache write failure

Download / Use:

M365Permissions module page | Github | PSGallery

M365Permissions v1.0.6

  • [Feature] Add multi-threading for huge performance gains
  • [Feature] Subclassify user as Internal or External
  • [Feature] Split SpO into three tabs
  • [Feature] Add Entra hidden webhooks (subscriptions)
  • [Bugfix] Improve progress bars

For more info:

M365Permissions module page || Github || PSGallery

Managed Identity auth against PowerBi Rest API’s

on https://learn.microsoft.com/en-us/rest/api/power-bi/ I couldn’t (easily) find if Managed Identities are supported when using the PowerBI rest API, especially the ‘asadmin’ parts.

The documentation also doesn’t really show (or I couldn’t find it), for what audience to request a token. Using a Logic App I eventually got it to work after a lot of trial and error 🙂

For those googling this, I encountered a bunch of these first before finding the right audience of ‘https://api.fabric.microsoft.com’

Http request failed as there is an error getting AD OAuth token: ‘AADSTS500011: The resource principal named https://api.fabric.microsoft.com/.default was not found in the tenant named XXXXX. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant.

Http request failed as there is an error getting AD OAuth token: ‘AADSTS500011: The resource principal named https://api.powerbi.com was not found in the tenant named XXX

Http request failed as there is an error getting AD OAuth token: ‘AADSTS500011: The resource principal named https://analysis.windows.net/powerbi/api/.default was not found in the tenant named XXX

Http request failed as there is an error getting AD OAuth token: ‘AADSTS500011: The resource principal named https://analysis.windows.net was not found in the tenant named XXX

Import a PBIX to PowerBI using PowerShell

Reading up on the PowerBI API to import PBIX files to the PowerBI service and an example on the actual request I decided to write a PowerShell function to import a PowerBI PBIX file to the PowerBI service.

The PowerBI Import API is quite specific and kept giving me 400’s like:

  • “Bad Request” with no details
  • UnknownError pbi.error exceptionCulprit 1 (loved this one)
  • MultiPartMimeStreamFormatException
  • RequestedFileIsEncryptedOrCorrupted

Eventually I figured out how to import my reports directly into PowerBI, so to help you automate importing your reports into workspaces or directly to customers using PowerShell, I’ll share my PowerShell function with you:

GitLab: Import-PBIXToPowerBI.ps1