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






