Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
I am using a service account to run Power BI APIs.
When I use APIs like GET-PowerBI Workspace here no success it returns the workspace of which it is admin.
However, when I use it with Invoke-PowerBIRestMethod APIs I get this error message:
Invoke-PowerBIRestMethod : Une ou plusieurs erreurs se sont produites.
Au caractère Ligne:26 : 1
+ Invoke-PowerBIRestMethod -Url "https://api.powerbi.com/v1.0/myorg/pip ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Microsoft.Power...werBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIRestMethod], AggregateException
+ FullyQualifiedErrorId : Une ou plusieurs erreurs se sont produites.,Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod
Invoke-PowerBIRestMethod : Encountered errors when invoking the command: {
"code": "PowerBINotAuthorizedException",
"pbi.error": {
"code": "PowerBINotAuthorizedException",
"parameters": {},
"details": [],
"exceptionCulprit": 1
}
}
Au caractère Ligne:26 : 1
+ Invoke-PowerBIRestMethod -Url "https://api.powerbi.com/v1.0/myorg/pip ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : WriteError: (Microsoft.Power...werBIRestMethod:InvokePowerBIRestMethod) [Invoke-PowerBIRestMethod], Exception
+ FullyQualifiedErrorId : Encountered errors when invoking the command: {
"code": "PowerBINotAuthorizedException",
"pbi.error": {
"code": "PowerBINotAuthorizedException",
"parameters": {},
"details": [],
"exceptionCulprit": 1
}
},Microsoft.PowerBI.Commands.Profile.InvokePowerBIRestMethod
For info the service account has a PowerBI PRO license.
Does anyone have a solution?
Thanks in advance,
Charline
Solved! Go to Solution.
Hello,
My problem is solved, it was just a right problem
Thank you @lbendlin and @Anonymous for your answers 🙂
Hello,
My problem is solved, it was just a right problem
Thank you @lbendlin and @Anonymous for your answers 🙂
HI @Charline_74,
Can you please share some more detail about your scripts and credentials/permission settings? They will help us clarify your scenario and test to troubleshoot.
Power BI REST APIs for embedded analytics and automation - Power BI REST API | Microsoft Learn
In addition, what type of credentials are you used? Power bi account or service principal?
If you mean service principal, they seem not able to be used as global variables and you need to re-input these credentials before API usages.
Regards,
Xiaoxin Sheng
The Power BI REST API documentation lists for every call if it can be made from a service principal. Which calls are you attempting?
User | Count |
---|---|
5 | |
4 | |
4 | |
2 | |
2 |
User | Count |
---|---|
8 | |
6 | |
4 | |
4 | |
4 |