As an ISV building solutions on top of Microsofts business platforms, our organization needs to have a well defined approach to deploy Power BI Reports and Datasets that can be part of our continuous delivery systems within Azure DevOps delivery pipelines.
In order to properly repoint our power bi reports to a newly deployed dataset, we need the PbiServiceModelId value, which appears to be a unique numeric id assigned to a dataset. The public powerbi REST api does not return this value, only the dataset's guid value.
Using various tracing tools, I found I was able to get the PbiServiceModelId values using an undocumented api. In commercial cloud, once I get a valid powerbi context, I can call:
and it will return the id values (along with other metadata) for every dataset my user has access to.
Unfortunately, we require this to be part of an automated pipeline. For all of our other pipeline work, we use a service principal to call the REST api. The above rest call does not work with a service principal - it will return the error "API is not accessible for application". It will only work when using an actual Azure account.
So three questions:
1) Is there a different (more acceptable) way to properly repoint our power bi reports to a newly deployed dataset?
2) If not, is there a better way to get the PbiServiceModelId for a dataset?
3) If there is no better way, then is there a way to make the (undocumented) rest call using a service principal account?
As a final note, we need this to work in both commercial and gov cloud. I have the url for the undocumented api for both.