This summary is produced by the author, and not by AI.
This article provides step-by-step instructions on how to enable service principal access to a Power BI workspace in dedicated capacity (Power BI Premium or Embedded A SKU).
In the following, I will try to highlight the minimal number of steps necessary to enable service principal authentication. You can find all the details in the official documentation: Automate Premium workspace and semantic model tasks with service principals.
The command-line steps below use the original, Windows-only Tabular Editor 2 CLI (TabularEditor.exe). There is now a modern, cross-platform Tabular Editor 3 CLI (te) that runs on Windows, macOS, and Linux. Check out the documentation, download it, or read the introduction post.
In order to set up unattended jobs or pipelines that perform XMLA write operations (refresh, deploy, etc.) on a dataset in a Power BI workspace, we have to use a service principal. Specifically, if we want to use Tabular Editor’s command-line interface to perform a model deployment, we don’t have any other options, as the command line doesn't allow interactive authentication, which is required on any tenant that has multifactor authentication (MFA) enabled.
These are the steps we need to go through in order to set this up. Note, these steps have to be performed by a user with Power BI administrator and Azure Active Directory administrator permissions:
For most scenarios that involve Tabular Editor, we need to enable XMLA read/write on our Power BI workspace.
powerbi://api.powerbi.com/v1.0/<organization name>/<workspace name>
Warning: Once you make a change to a dataset hosted in an XMLA write-enabled workspace using external tools such as Tabular Editor, downloading the original .pbix file from the dataset is no longer possible. XMLA read/write has since reached general availability, but this limitation on the Power BI Service remains; see the linked workaround if you need the file back.
This limitation applied to older TabularEditor.exe builds. Current Tabular Editor CLI workflows handle Power BI service database IDs independently of their names; use the current CLI documentation linked above for automation.
Sometimes, it can take a few minutes for all of the settings in the above steps to come through, so go grab a cup of coffee. When you come back, you can test the service principal connection using Tabular Editor. Provide the following connection string as the “server name” when connecting:
Provider=MSOLAP;Data Source=<xmla endpoint>;User ID=app:<application id>@<tenant id>;Password=<application secret>
Make sure to replace the placeholders with their actual values:
<xmla endpoint> (same as when connecting manually: powerbi://api.powerbi.com/v1.0/<organization name>/<workspace name>)<application id> (from the service principal)<tenant id> (from Azure Active Directory)<application secret> (from the service principal)Remember – if you want to make a change to the model, you only need to hit Ctrl+S to save the change directly back to the Power BI Premium capacity (this is probably not the best thing to do on a production dataset…). Alternatively, you can deploy the model metadata as a new dataset by going to the Model > Deploy menu (or hit F6), and then use the same connection string for the server name.
You can also perform the deployment using Tabular Editor's command-line interface, which is what you typically need for CI/CD integration. For example, to deploy a local Model.bim file as a dataset named AdventureWorks use the following command. The -O switch allows you to overwrite an existing dataset with the same name:
start /wait TabularEditor.exe Model.bim -D "Provider=MSOLAP;Data Source=<xmla endpoint>;User ID=app:<application id>@<tenant id>;Password=<application secret>" "AdventureWorks" -O
That’s it! Feel free to post questions below or on GitHub.
And that’s the whole setup. It’s a fair few steps across the Power BI and Azure portals, but you only have to do it once. After that, you’ve got a service principal that can refresh, deploy, and edit your datasets without anyone signing in, which is exactly what you need for CI/CD or any other unattended job. Enable XMLA read/write, register the service principal, give it access to the workspace, and you’re ready to point Tabular Editor or a pipeline at your Premium capacity.
Deploy Power BI models unattended over XMLA with Tabular Editor 3.
Give Tabular Editor a spin