Forum Discussion
Why am I getting licensing errors when logging and publishing Datamodels into PowerBI Service?
- Anonymous1 year ago
Hi SergikitoDZ ,
According to my research, it seems that there is no way to assign any license to the service principal, which is supposed to be registered for authentication purposes, in which case the solution can only be run using the PBI workspace backed by the Premium capacity, which is supposed to provide the corresponding pro license functionality. The PPU capacity should also be able to provide the functionality of the corresponding pro license.
Power BI service features by license type - Power BI | Microsoft Learn
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- 1 year ago
Thank you!
What I found was that despite what the tutorial says, it is not possible to publish a .bim file to a pro workspace, since it will need an XMLA endpoint, and XMLA endpoints are only available for Premium and PPU workspaces
Hi SergikitoDZ ,
As far as I know, if you are using the Premium feature of the PBI workspace, whether you are using the UI click method or the API method, you need to monitor and check if your workspace is Premium capacity. If not, you will encounter a similar error: 'pbi.error': {'code': 'PowerBINotLicensedException'}. So if you currently only have a Pro workspace and aim to automate the deployment of your PBI data model to the workspace in the PBI service while maintaining CI/CD, you may need to see if there is a way to automate it without Premium if needed. Alternatively, you can double-check the documentation to see if PPU's license assignments to a workspace support bypassing the 'PowerBINotLicensedException' error.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello Anonymous , thank you for your answer!
I don't understand why the Premium workspace should be needed. Which one is the Premium feature I am trying to use?
I probably wasn't precise enough in my previous post, or there is something that I am still not understanding: in the linked tutorial, it says that the Premium workspace is just needed in case you want to activate and have the PowerBI Deployment Pipeline tool and the multiple environments, which is not the case.
In case I wasn't precise enough: what I am trying to do is to deploy a .bim file into a Pro workspace using the API using a Service Principal. From my understanding, there shouldn't be a use of a Premium feature on those steps 🙃.
I have also tried calling the API using Powershell in two different ways, but I get the same error:
Deploy option 1
PS C:\WINDOWS\system32> D:\Downloads\TabularEditor.Portable\TabularEditor.exe "D:\Downloads\Model.bim" -D "Provider=MSOLAP;Data Source=powerbi://api.powerbi.com/v1.0/myorg/WorkspaceModels;User ID=app:[ClientID]@[TenantID];Password=[SecretID];" "Model Name" -O -C -R -M -E -V
Return
Tabular Editor 2.25.0 (build 2.25.8952.22276)
--------------------------------
Loading model...
Deploying...
##vso[task.logissue type=error;]Deployment failed! PowerBI Request Failed.
Action: Generating MWC token
Description: {"error":{"code":"PowerBINotLicensedException","pbi.error":{"code":"PowerBINotLicensedException","parameters":{},"details":[],"exceptionCulprit":1}}}
Technical Details:
RootActivityId: 48e5a1d2-xxxx-xxxx-xxxx-xxxxxxxxxxx
##vso[task.complete result=Failed;]Done.
Deploy option 1
PS C:\WINDOWS\system32> Start-Process D:\Downloads\TabularEditor.Portable\TabularEditor.exe -Wait -ArgumentList '"D:\Downloads\Model.bim" -D "Provider=MSOLAP;Data Source=powerbi://api.powerbi.com/v1.0/myorg/WorkspaceModels;User ID=app:[ClientID]@[TenantID];Password=[SecretID];" "Model Name" -O -C -P -V -E'
Return
Tabular Editor 2.25.0 (build 2.25.8952.22276)
--------------------------------
Loading model...
Deploying...
##vso[task.logissue type=error;]Deployment failed! PowerBI Request Failed.
Action: Generating MWC token
Description: {"error":{"code":"PowerBINotLicensedException","pbi.error":{"code":"PowerBINotLicensedException","parameters":{},"details":[],"exceptionCulprit":1}}}
Technical Details:
RootActivityId: e87093d1-xxxx-xxxx-xxxx-xxxxxxxxxxx
##vso[task.complete result=Failed;]Done.
Deploy option 3
Based on the following structure ($headers containing the .bim file in Base64 format and the access token)
Invoke-RestMethod -Method Post -ContentType "application/x-www-form-urlencoded" -Headers $headers -Uri "http://api.powerbi.com/v1.0/myorg/groups/4f920461-xxxx-xxxx-xxxx-xxxxxxxxxxxx/models"
Return
Invoke-RestMethod : The remote server returned an error: (404) Not Found.
At line:1 char:1
+ Invoke-RestMethod -Method Post -ContentType "application/x-www-form-u ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Kind regards