cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JoanLel
Regular Visitor

PowerShell Unable to connect with app registration

Dear community,

 

I need to get a report about usage of PowerBI in my tenant.

 

I installed PowerBi module, but when I try to connect with App Registration, I get nothing but errors. 

 

My app has following permissions:

 

JoanLel_0-1636375941185.png

 

I tried 2 methodes to connect:

 

1. Connect-PowerBIServiceAccount -ServicePrincipal -CertificateThumbprint xxxxxx -ApplicationId yyyyyyyy

Error: 

JoanLel_1-1636376009363.png

 

 

2. Solution found here: https://github.com/microsoft/powerbi-powershell/issues/215

$secureServicePrincipalPassword= ConvertTo-SecureString $ServicePrincipalSecret -AsPlainText -Force
 $servicePrincipal = New-Object -TypeName PSCredential -ArgumentList $ServicePrincipalId, $secureServicePrincipalPassword
 Connect-PowerBIServiceAccount -ServicePrincipal -Credential $servicePrincipal -Environment Public -Tenant xxxxxxxx

Error:

JoanLel_2-1636376211260.png

 

And I am quite sure, that I can coppy the ID rom AAD. 

 

Do you have an idea, what is wrong here?

 

1 ACCEPTED SOLUTION
yingyinr
Community Support
Community Support

Hi @JoanLel ,

Based on your error message, it seems to be a problem with permissions and account authentication. Are you trying to use Powershell to call some API or implement some other functionality? Could you provide more detailed information please? Before using Powershell, please check the prerequisite information below to make sure you have the proper permissions.

Microsoft Power BI Cmdlets for Windows PowerShell and PowerShell Core


Usage

Two scopes are supported by cmdlets that interact with Power BI entities:

  • Individual is used to access entities that belong to the current user.
  • Organization is used to access entities across the entire company. Only Power BI tenant admins are allowed to use.

If the -Scope parameter doesn't exist on the cmdlet, the entity doesn't support an Administrative API.


In addition, here are some links that describe using Powershell to get Power BI information. Please check them out and I hope they will help you.

Power BI Usage Metrics Across All Workspaces: Step by Step

Power BI PowerShell and the Admin API

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
yingyinr
Community Support
Community Support

Hi @JoanLel ,

Based on your error message, it seems to be a problem with permissions and account authentication. Are you trying to use Powershell to call some API or implement some other functionality? Could you provide more detailed information please? Before using Powershell, please check the prerequisite information below to make sure you have the proper permissions.

Microsoft Power BI Cmdlets for Windows PowerShell and PowerShell Core


Usage

Two scopes are supported by cmdlets that interact with Power BI entities:

  • Individual is used to access entities that belong to the current user.
  • Organization is used to access entities across the entire company. Only Power BI tenant admins are allowed to use.

If the -Scope parameter doesn't exist on the cmdlet, the entity doesn't support an Administrative API.


In addition, here are some links that describe using Powershell to get Power BI information. Please check them out and I hope they will help you.

Power BI Usage Metrics Across All Workspaces: Step by Step

Power BI PowerShell and the Admin API

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!