SQL Server, Power BI, and other Business Intelligence and data technologies

Month: November 2021

Adding a Non-Email Enabled Object to Power BI Gateway Cluster Users

The Power BI On-premise Enterprise Gateway allows for users to be added as administrators of the gateway cluster via the Powerbi.com portal.

One annoying quirk about this, however, is that at least as of this writing, it is impossible to add users (or groups) which do not have an email address via the user interface.

Attempting to do so will give the error message “These email addresses are invalid or duplicate.” Pretty annoying!

It turns out that it is actually possible to add objects which do not have email addresses associated with them (groups, users, even application SPNs), however it must be done with PowerShell.

Continue reading

Authenticating to the Power BI REST API with C# via SPN (Part 2 – C# Application)

This post will be a quick primer on authenticating to the Power BI REST API utilizing a C# console application with SPN authentication (Application ID / Client Secret) and utilizing the MSAL library.

For anybody that has followed my previous posts this method is going to be largely similar with only minor differences in the key details. SPN authentication is preferred over Username / Password authentication as it allows the console application to truly authenticate as an application and not “as a user.” This is a much more secure and better method (though it is hasn’t always been available and some API functions don’t yet support this method, sadly). Authenticating via the MSAL library instead of the ADAL library is preferred as Microsoft has announced the termination of support for the ADAL library, so best to keep with the times.

Continue reading

Authenticating to the Power BI REST API with C# via SPN (Part 1 – Cloud Setup)

A few years ago, I explored connecting to the Power BI REST API with a simple C# console application to retrieve metadata (such as a report inventory and usage information) in my post here.

In order to utilize the Power BI API, you must authenticate to it. In my post, I explored authenticating with a standard username and password. So long as you are not using multi-factor authentication (MFA), this is functional (but not necessarily the best security). If you have MFA enabled, then you cannot use a stored username and password in this manner, so we need another solution. Enter SPN authentication.

The Power BI API initially didn’t have great support for SPN authentication (basic functionality entered Preview in February of 2019), but it has improved greatly over time and is now at the point where it is very usable by custom applications that wish to read data from the API. There are a few extra configuration steps which are necessary in order to get this setup which I’ll cover below.

Continue reading

© 2026 Jeff Pries

Theme by Anders NorenUp ↑